<?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>io.github.rabobank</groupId>
    <artifactId>ret</artifactId>
    <version>0.1.0</version>
    <packaging>pom</packaging>
    <name>RET Engineering Tools</name>
    <url>https://github.com/rabobank/ret-engineering-tools</url>
    <description>RET Engineering Tools</description>
    <inceptionYear>2023</inceptionYear>

    <licenses>
        <license>
            <name>'MIT License'</name>
            <url>https://github.com/rabobank/ret-engineering-tools/blob/main/LICENSE</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/rabobank/ret-engineering-tools.git</connection>
        <developerConnection>scm:git:https://github.com/rabobank/ret-engineering-tools.git</developerConnection>
        <url>https://github.com/rabobank/ret-engineering-tools</url>
        <tag>0.1.0</tag>
    </scm>

    <developers>
        <developer>
            <id>Rabobank</id>
        </developer>
    </developers>

    <modules>
        <module>ret-core</module>
        <module>ret-cli</module>
        <module>ret-plugin</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <kotlin.code.style>official</kotlin.code.style>
        <kotlin.version>1.8.21</kotlin.version>
        <maven.compiler.release>17</maven.compiler.release>
        <dokka-maven-plugin.version>1.8.10</dokka-maven-plugin.version>
        <maven-assembly-plugin.version>3.6.0</maven-assembly-plugin.version>
        <maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
        <maven-release-plugin.version>3.0.0</maven-release-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <compiler-plugin.version>3.11.0</compiler-plugin.version>
        <quarkus.platform.version>3.0.3.Final</quarkus.platform.version>
        <git-commit-id.version>5.0.0</git-commit-id.version>
        <os-maven-plugin.version>1.7.1</os-maven-plugin.version>
        <surefire-plugin.version>3.1.0</surefire-plugin.version>
        <failsafe-plugin.version>3.1.0</failsafe-plugin.version>
        <jandex-maven-plugin.version>1.2.3</jandex-maven-plugin.version>
        <jreleaser-maven-plugin.version>1.6.0</jreleaser-maven-plugin.version>

        <assertj-core.version>3.24.2</assertj-core.version>
        <commons-lang3.version>3.12.0</commons-lang3.version>
        <mockito-kotlin.version>4.1.0</mockito-kotlin.version>
        <quarkus-jgit.version>3.0.0</quarkus-jgit.version>
        <quarkus-junit5-mockk.version>2.0.0</quarkus-junit5-mockk.version>
        <sshd-core.version>2.9.2</sshd-core.version>
        <testcontainers.version>1.18.1</testcontainers.version>
        <maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.quarkus.platform</groupId>
                <artifactId>quarkus-bom</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>io.quarkiverse.jgit</groupId>
                <artifactId>quarkus-jgit</artifactId>
                <version>${quarkus-jgit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>

            <dependency>
                <groupId>io.quarkiverse.mockk</groupId>
                <artifactId>quarkus-junit5-mockk</artifactId>
                <version>${quarkus-junit5-mockk.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito.kotlin</groupId>
                <artifactId>mockito-kotlin</artifactId>
                <version>${mockito-kotlin.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj-core.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers</artifactId>
                <version>${testcontainers.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${testcontainers.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.sshd</groupId>
                <artifactId>sshd-core</artifactId>
                <version>${sshd-core.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${failsafe-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire-plugin.version}</version>
                    <configuration>
                        <systemPropertyVariables>
                            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                            <maven.home>${maven.home}</maven.home>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>io.quarkus.platform</groupId>
                    <artifactId>quarkus-maven-plugin</artifactId>
                    <version>${quarkus.platform.version}</version>
                    <extensions>true</extensions>
                    <executions>
                        <execution>
                            <goals>
                                <goal>build</goal>
                                <goal>generate-code</goal>
                                <goal>generate-code-tests</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${compiler-plugin.version}</version>
                    <configuration>
                        <compilerArgs>
                            <arg>-parameters</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${kotlin.version}</version>
                    <executions>
                        <execution>
                            <id>compile</id>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>test-compile</id>
                            <goals>
                                <goal>test-compile</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.jetbrains.kotlin</groupId>
                            <artifactId>kotlin-maven-allopen</artifactId>
                            <version>${kotlin.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <javaParameters>true</javaParameters>
                        <jvmTarget>${maven.compiler.release}</jvmTarget>
                        <compilerPlugins>
                            <plugin>all-open</plugin>
                        </compilerPlugins>
                        <pluginOptions>
                            <option>all-open:annotation=javax.ws.rs.Path</option>
                            <option>all-open:annotation=javax.enterprise.context.ApplicationScoped</option>
                            <option>all-open:annotation=io.quarkus.test.junit.QuarkusTest</option>
                        </pluginOptions>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>io.github.git-commit-id</groupId>
                    <artifactId>git-commit-id-maven-plugin</artifactId>
                    <version>${git-commit-id.version}</version>
                    <executions>
                        <execution>
                            <id>get-the-git-infos</id>
                            <goals>
                                <goal>revision</goal>
                            </goals>
                            <phase>initialize</phase>
                        </execution>
                    </executions>
                    <configuration>
                        <generateGitPropertiesFile>true</generateGitPropertiesFile>
                        <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties
                        </generateGitPropertiesFilename>
                        <includeOnlyProperties>
                            <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
                            <includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
                        </includeOnlyProperties>
                        <commitIdGenerationMode>full</commitIdGenerationMode>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jboss.jandex</groupId>
                    <artifactId>jandex-maven-plugin</artifactId>
                    <version>${jandex-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>make-index</id>
                            <goals>
                                <goal>jandex</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.jreleaser</groupId>
                    <artifactId>jreleaser-maven-plugin</artifactId>
                    <version>${jreleaser-maven-plugin.version}</version>
                    <inherited>false</inherited>
                    <configuration>
                        <jreleaser>
                            <release>
                                <github>
                                    <tagName>{{projectVersion}}</tagName>
                                    <releaseName>{{projectVersion}}</releaseName>
                                    <overwrite>true</overwrite>
                                    <changelog>
                                        <formatted>ALWAYS</formatted>
                                        <format>- {{commitShortHash}} {{commitTitle}}</format>
                                        <preset>conventional-commits</preset>
                                        <contributors>
                                            <format>- {{contributorName}}</format>
                                        </contributors>
                                        <hide>
                                            <categories>merge</categories>
                                            <contributors>GitHub,dependabot,Skunk Works Rabot</contributors>
                                        </hide>
                                    </changelog>
                                </github>
                            </release>
                            <distributions>
                                <ret>
                                    <type>BINARY</type>
                                    <artifacts>
                                        <artifact>
                                            <path>{{artifactsDir}}/{{distributionName}}-{{projectVersion}}-linux-x86_64.zip</path>
                                            <platform>linux-x86_64</platform>
                                        </artifact>
                                        <artifact>
                                            <path>{{artifactsDir}}/{{distributionName}}-{{projectVersion}}-osx-x86_64.zip</path>
                                            <platform>osx-x86_64</platform>
                                        </artifact>
                                    </artifacts>
                                </ret>
                            </distributions>
                            <signing>
                                <active>ALWAYS</active>
                                <armored>true</armored>
                            </signing>
                            <deploy>
                                <maven>
                                    <nexus2>
                                        <maven-central>
                                            <active>ALWAYS</active>
                                            <url>https://s01.oss.sonatype.org/service/local</url>
                                            <snapshotUrl>https://s01.oss.sonatype.org/content/repositories/snapshots/</snapshotUrl>
                                            <closeRepository>true</closeRepository>
                                            <releaseRepository>true</releaseRepository>
                                            <stagingRepositories>artifacts-plugin</stagingRepositories>
                                            <verifyPom>false</verifyPom>
                                        </maven-central>
                                    </nexus2>
                                </maven>
                            </deploy>
                            <packagers>
                                <brew>
                                    <active>ALWAYS</active>
                                </brew>
                            </packagers>
                        </jreleaser>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>kr.motd.maven</groupId>
                    <artifactId>os-maven-plugin</artifactId>
                    <version>${os-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jetbrains.dokka</groupId>
                    <artifactId>dokka-maven-plugin</artifactId>
                    <version>${dokka-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>publication</id>
            <properties>
                <altDeploymentRepository>local::file:./target/staging-deploy</altDeploymentRepository>
            </properties>
            <build>
                <defaultGoal>deploy</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <attach>true</attach>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <attach>true</attach>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
