<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.github.locke-chappel.oss</groupId>
    <artifactId>parent</artifactId>
    <version>1.0.2</version>
    <packaging>pom</packaging>
    <name>OSS Parent POM</name>
    <description>Parent POM for all io.github.locke-chappel.oss projects</description>
    <url>https://github.com/locke-chappel/oss-parent</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>locke-chappel</id>
            <name>Locke-Chappel</name>
        </developer>
    </developers>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/locke-chappel/oss-parent/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:git://github.com/locke-chappel/oss-parent.git</connection>
        <developerConnection>scm:git:ssh://github.com:locke-chappel/oss-parent.git</developerConnection>
        <url>https://github.com/locke-chappel/oss-parent</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.min.version>1.8</java.min.version>
        <java.module.version>17</java.module.version>
        <maven.compiler.target>${java.min.version}</maven.compiler.target>
        <maven.compiler.source>${java.min.version}</maven.compiler.source>

        <!-- io.github.locke-chappel.oss -->
        <io.github.lc.oss.commons.bom.version>1.0.2</io.github.lc.oss.commons.bom.version>
        <io.github.lc.oss.owasp.version>1.0.2</io.github.lc.oss.owasp.version>

        <!-- Dependency Versions -->
        <com.fasterxml.jackson.version>2.14.2</com.fasterxml.jackson.version>
        <com.github.mwiede.jsch.version>0.2.8</com.github.mwiede.jsch.version>
        <com.google.javascript.version>v20220719</com.google.javascript.version>
        <com.h2database.version>2.1.214</com.h2database.version>
        <com.pi4j.version>2.3.0</com.pi4j.version>
        <com.yahoo.platform.yui.version>2.4.8</com.yahoo.platform.yui.version>
        <jakarta.servlet.version>6.0.0</jakarta.servlet.version>
        <org.apache.commons.version>3.12.0</org.apache.commons.version>
        <org.apache.httpcomponents.version>5.2.1</org.apache.httpcomponents.version>
        <org.aspectj.version>1.9.19</org.aspectj.version>
        <org.eclipse.angus.jakarta.mail.version>2.0.1</org.eclipse.angus.jakarta.mail.version>
        <org.glassfish.jaxb.version>4.0.2</org.glassfish.jaxb.version>
        <org.graalvm.js.version>22.3.1</org.graalvm.js.version>
        <org.hibernate.version>6.1.7.Final</org.hibernate.version>
        <org.hibernate.validator.version>8.0.0.Final</org.hibernate.validator.version>
        <org.junit.jupiter.version>5.9.2</org.junit.jupiter.version>
        <org.mockito.version>4.11.0</org.mockito.version>
        <org.openjfx.version>17.0.6</org.openjfx.version>
        <org.quartz-scheduler.version>2.3.2</org.quartz-scheduler.version>
        <org.seleniumhq.selenium.version>4.8.2</org.seleniumhq.selenium.version>
        <org.seleniumhq.selenium.htmlunit-driver.version>4.8.1.1</org.seleniumhq.selenium.htmlunit-driver.version>
        <org.slf4j.verion>2.0.7</org.slf4j.verion>
        <org.springframework.version>6.0.7</org.springframework.version>
        <org.springframework.boot.version>3.0.5</org.springframework.boot.version>
        <org.springframework.security.version>6.0.2</org.springframework.security.version>

        <!-- Plugin Versions -->
        <maven-assembly-plugin.version>3.4.2</maven-assembly-plugin.version>
        <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
        <maven-dependency-plugin.version>3.5.0</maven-dependency-plugin.version>
        <maven-deploy-plugin.version>3.1.0</maven-deploy-plugin.version>
        <maven-failsafe-plugin.version>3.0.0-M9</maven-failsafe-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
        <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
        <maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
        <maven-release-plugin.version>3.0.0-M7</maven-release-plugin.version>
        <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>3.0.0-M9</maven-surefire-plugin.version>
        <org.cyclonedx.cyclonedx-maven-plugin.version>2.7.5</org.cyclonedx.cyclonedx-maven-plugin.version>
        <org.eclipse.m2e.lifecycle-mapping.version>1.0.0</org.eclipse.m2e.lifecycle-mapping.version>
        <org.graalvm.buildtools.native-build-tools-plugin.version>0.9.20</org.graalvm.buildtools.native-build-tools-plugin.version>
        <org.jacoco.jacoco-maven-plugin.version>0.8.8</org.jacoco.jacoco-maven-plugin.version>
        <org.ow2.asm.version>9.4</org.ow2.asm.version>
        <org.owasp.dependency-check-maven.version>8.2.1</org.owasp.dependency-check-maven.version>

        <!-- Configuration -->
        <testing.skip.it>true</testing.skip.it>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                </plugin>

                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>default-compile</id>
                            <configuration>
                                <jdkToolchain>
                                    <version>${java.module.version}</version>
                                </jdkToolchain>
                                <release>${java.module.version}</release>
                                <source>${java.module.version}</source>
                                <target>${java.module.version}</target>
                            </configuration>
                        </execution>
                        <execution>
                            <id>base-compile</id>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <excludes>
                                    <exclude>module-info.java</exclude>
                                </excludes>
                            </configuration>
                        </execution>
                    </executions>
                    <configuration>
                        <jdkToolchain>
                            <version>${java.min.version}</version>
                        </jdkToolchain>
                        <source>${java.min.version}</source>
                        <target>${java.min.version}</target>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.ow2.asm</groupId>
                            <artifactId>asm</artifactId>
                            <version>${org.ow2.asm.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-failsafe-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <keyname>${gpg.keyname}</keyname>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${org.jacoco.jacoco-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <!-- https://jeremylong.github.io/DependencyCheck -->
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>${org.owasp.dependency-check-maven.version}</version>
                    <configuration>
                        <failBuildOnCVSS>8</failBuildOnCVSS>
                        <suppressionFiles>
                            <suppressionFile>all.xml</suppressionFile>
                        </suppressionFiles>
                        <cveUrlBase>${owasp.cveUrlBase}</cveUrlBase>
                        <cveUrlModified>${owasp.cveUrlModified}</cveUrlModified>
                        <retireJsUrl>${owasp.retireJsUrl}</retireJsUrl>
                        <dataDirectory>${owasp.dataDir}</dataDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>io.github.locke-chappel.oss</groupId>
                            <artifactId>owasp</artifactId>
                            <version>${io.github.lc.oss.owasp.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.cyclonedx</groupId>
                    <artifactId>cyclonedx-maven-plugin</artifactId>
                    <version>${org.cyclonedx.cyclonedx-maven-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.graalvm.buildtools</groupId>
                    <artifactId>native-maven-plugin</artifactId>
                    <version>${org.graalvm.buildtools.native-build-tools-plugin.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <skipNativeTests>true</skipNativeTests>
                        <buildArgs>
                            <buildArg>--no-fallback</buildArg>
                            <buildArg>--no-server</buildArg>
                            <buildArg>--verbose</buildArg>
                            <buildArg>-J-Xmx3G</buildArg>
                        </buildArgs>
                    </configuration>
                </plugin>
                
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>${org.eclipse.m2e.lifecycle-mapping.version}</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-dependency-plugin</artifactId>
                                        <versionRange>[3.1.2,)</versionRange>
                                        <goals>
                                            <goal>unpack</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <argLine>${JacocoArgs}</argLine>
                    <skipITs>${testing.skip.it}</skipITs>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>${JacocoArgs}</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>pre-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <destFile>${project.build.directory}/jacoco.exec</destFile>
                            <propertyName>JacocoArgs</propertyName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>native</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <configuration>
                            <image>
                                <builder>paketobuildpacks/builder:tiny</builder>
                                <env>
                                    <BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
                                </env>
                            </image>
                        </configuration>
                        <executions>
                            <execution>
                                <id>process-aot</id>
                                <goals>
                                    <goal>process-aot</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <configuration>
                            <classesDirectory>${project.build.outputDirectory}</classesDirectory>
                            <metadataRepository>
                                <enabled>true</enabled>
                            </metadataRepository>
                            <requiredVersion>22.3</requiredVersion>
                        </configuration>
                        <executions>
                            <execution>
                                <id>add-reachability-metadata</id>
                                <goals>
                                    <goal>add-reachability-metadata</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>build-native</id>
                                <goals>
                                    <goal>compile-no-fork</goal>
                                </goals>
                                <phase>package</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>nativeTest</id>
            <dependencies>
                <dependency>
                    <groupId>org.junit.platform</groupId>
                    <artifactId>junit-platform-launcher</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process-test-aot</id>
                                <goals>
                                    <goal>process-test-aot</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <configuration>
                            <classesDirectory>${project.build.outputDirectory}</classesDirectory>
                            <metadataRepository>
                                <enabled>true</enabled>
                            </metadataRepository>
                            <requiredVersion>22.3</requiredVersion>
                        </configuration>
                        <executions>
                            <execution>
                                <id>native-test</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
