<?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>software.tnb</groupId>
    <artifactId>tnb-parent</artifactId>
    <version>0.0.2</version>
    <packaging>pom</packaging>
    <name>TNB :: Parent</name>
    <description>The New Beginning Framework</description>
    <url>https://github.com/tnb-software/TNB</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:tnb-software/TNB.git</connection>
        <developerConnection>scm:git:git@github.com:tnb-software/TNB</developerConnection>
        <url>https://github.com/tnb-software/TNB.git</url>
    </scm>

    <developers>
        <developer>
            <id>asmigala</id>
            <name>Andrej Smigala</name>
        </developer>
        <developer>
            <id>avano</id>
            <name>Andrej Vano</name>
        </developer>
        <developer>
            <id>bouskaJ</id>
            <name>Jan Bouska</name>
        </developer>
        <developer>
            <id>Croway</id>
            <name>Federico Mariani</name>
        </developer>
        <developer>
            <id>lfabriko</id>
            <name>Lucie Krejcirova</name>
        </developer>
        <developer>
            <id>mcarlett</id>
            <name>Marco Carletti</name>
        </developer>
        <developer>
            <id>mmuzikar</id>
            <name>Martin Muzikar</name>
        </developer>
        <developer>
            <id>tplevko</id>
            <name>Tomas Plevko</name>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <modules>
        <module>common</module>
        <module>system-x</module>
        <module>fuse-products</module>
        <module>bom</module>
    </modules>

    <properties>
        <auto-service.version>1.0.1</auto-service.version>
        <!--
          Careful when upgrading this version, as it also defines the camel-k-client version in fuse-products,
          that brings model classes aligned to a specific camel-k-release version
         -->
        <kubernetes.client.version>5.12.2</kubernetes.client.version>
        <javaparser.version>3.24.2</javaparser.version>
        <maven.compiler.plugin.version>3.10.1</maven.compiler.plugin.version>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <testcontainers.version>1.17.2</testcontainers.version>
        <xtf.version>0.26</xtf.version>
        <maven.surefire.plugin.version>2.22.2</maven.surefire.plugin.version>
        <skip.tests>true</skip.tests>
        <jacoco.maven.plugin.version>0.8.8</jacoco.maven.plugin.version>
        <jgit.version>6.2.0.202206071550-r</jgit.version>
        <junit.version>5.8.2</junit.version>
        <assertj.version>3.23.1</assertj.version>
        <awaitility.version>4.2.0</awaitility.version>
        <log4j.version>2.17.2</log4j.version>
        <vault.version>5.1.0</vault.version>
        <nexus.staging.plugin.version>1.6.13</nexus.staging.plugin.version>
        <source.plugin.version>3.2.1</source.plugin.version>
        <javadoc.plugin.version>3.4.0</javadoc.plugin.version>
        <gpg.plugin.version>3.0.1</gpg.plugin.version>
        <git.changelog.maven.plugin>1.92</git.changelog.maven.plugin>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>cz.xtf</groupId>
                <artifactId>core</artifactId>
                <version>${xtf.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers</artifactId>
                <version>${testcontainers.version}</version>
                <exclusions>
                    <!-- there is 2.10.x version coming through docker-java dependency and everything else uses 2.13.x -->
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-annotations</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>com.google.auto.service</groupId>
                            <artifactId>auto-service</artifactId>
                            <version>${auto-service.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <skip>${skip.tests}</skip>
                    <failIfNoTests>false</failIfNoTests>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>test</id>

            <properties>
                <skip.tests>false</skip.tests>
            </properties>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.maven.plugin.version}</version>
                        <configuration>
                            <excludes>
                                <exclude>system-x/**/*</exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <!-- attached to Maven test phase -->
                            <execution>
                                <id>report</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>unit</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.surefire.plugin.version}</version>
                        <configuration combine.self="append">
                            <groups>unit</groups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>integration</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.surefire.plugin.version}</version>
                        <configuration combine.self="append">
                            <groups>integration</groups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>deploy</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus.staging.plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </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>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${javadoc.plugin.version}</version>
                        <configuration>
                            <doclint>none</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>changelog</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>se.bjurr.gitchangelog</groupId>
                        <artifactId>git-changelog-maven-plugin</artifactId>
                        <version>${git.changelog.maven.plugin}</version>
                        <executions>
                            <execution>
                                <id>GenerateGitChangelog</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>git-changelog</goal>
                                </goals>
                                <configuration>
                                    <templateBaseDir>templates</templateBaseDir>
                                    <templateFile>templates/changelog.mustache</templateFile>
                                    <ignoreCommitsIfMessageMatches>Merge (pull request|branch).*</ignoreCommitsIfMessageMatches>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
