<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.phoeniqs.oss</groupId>
    <artifactId>fabric8-models</artifactId>
    <version>3.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>

    <modules>
        <module>fabric8-fluxcd-model</module>
        <module>fabric8-cnpg-model</module>
        <module>fabric8-kubevirt-model</module>
    </modules>

    <properties>
        <!-- Build properties -->
        <maven.compiler.release>21</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Plugins -->
        <compiler-plugin.version>3.15.0</compiler-plugin.version>
        <surefire-plugin.version>3.5.5</surefire-plugin.version>
        <enforcer-plugin.version>3.6.2</enforcer-plugin.version>
        <release-plugin.version>3.3.1</release-plugin.version>
        <source-plugin.version>3.4.0</source-plugin.version>
        <dependency-plugin.version>3.10.0</dependency-plugin.version>

        <!-- Dependency versions -->
        <fabric8.version>7.6.1</fabric8.version>
    </properties>

    <distributionManagement>
        <repository>
            <id>phoenix-oss</id>
            <url>https://git.kvant.cloud/api/packages/phoenix-oss/maven</url>
        </repository>
        <snapshotRepository>
            <id>phoenix-oss</id>
            <url>https://git.kvant.cloud/api/packages/phoenix-oss/maven</url>
        </snapshotRepository>
    </distributionManagement>

    <scm>
        <connection>scm:git:ssh://git@git-ssh.kvant.cloud:2222/phoenix-oss/fabric8-models.git</connection>
        <developerConnection>scm:git:ssh://git@git-ssh.kvant.cloud:2222/phoenix-oss/fabric8-models.git</developerConnection>
        <url>https://git.kvant.cloud/phoenix-oss/fabric8-models.git</url>
        <tag>HEAD</tag>
    </scm>

    <dependencies>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>generator-annotations</artifactId>
            <version>${fabric8.version}</version>
        </dependency>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>kubernetes-client</artifactId>
            <version>${fabric8.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin.version}</version>
                <configuration>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <configuration>
                    <systemPropertyVariables>
                        <maven.home>${maven.home}</maven.home>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                        <configuration>
                            <systemPropertyVariables>
                                <maven.home>${maven.home}</maven.home>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>ban-bad-log4j-versions</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>org.apache.logging.log4j:log4j-core:(,2.17.1)</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${release-plugin.version}</version>
                <configuration>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                    <checkModificationExcludes>mvnw</checkModificationExcludes>
                    <scmReleaseCommitComment>chore: release @{releaseLabel}</scmReleaseCommitComment>
                    <scmDevelopmentCommitComment>chore: prepare for next development iteration</scmDevelopmentCommitComment>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${dependency-plugin.version}</version>
            </plugin>
        </plugins>
    </build>
</project>
