<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>de.gematik.bbriccs</groupId>
    <artifactId>bbriccs-parent</artifactId>
    <version>0.7.0</version>
    <name>Bbriccs Parent</name>
    <description>Bbriccs provides reusable and independent building bricks for flexible and maintainable TestSuites with Clean Code Principles</description>
    <packaging>pom</packaging>

    <modules>
        <module>utility-bricks</module>
        <module>configuration-bricks</module>
        <module>perimeter-bricks</module>
        <module>fhir-bricks</module>
        <module>restful-bricks</module>
        <module>cli-tooling-bricks</module>
        <module>bricks-integration-coverage</module>
        <module>auth-bricks</module>
    </modules>

    <properties>
        <version.java>17</version.java>
        <java.version>${version.java}</java.version>
        <maven.compiler.target>${version.java}</maven.compiler.target>
        <maven.compiler.source>${version.java}</maven.compiler.source>
        <kotlin.version>2.0.0</kotlin.version>
        <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
        <kotlin.code.style>official</kotlin.code.style>
        <kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <encoding>UTF-8</encoding>

        <!-- Repositories will be set externally -->
        <releaseDeploymentRepository/>
        <snapshotDeploymentRepository/>

        <!-- Dependency versions -->
        <version.lombok>1.18.30</version.lombok>
        <version.logback>1.5.6</version.logback>
        <version.slf4j-api>2.0.11</version.slf4j-api>
        <version.guava>33.3.1-jre</version.guava>
        <version.hapi-fhir>7.2.3</version.hapi-fhir>
        <version.ref-validator>2.0.2</version.ref-validator>
        <version.fasterxml>2.18.1</version.fasterxml>
        <version.apache-commons-lang3>3.14.0</version.apache-commons-lang3>
        <version.faker>1.0.2</version.faker>
        <version.streamex>0.8.2</version.streamex>
        <version.junit>5.9.3</version.junit>
        <version.mockito>5.12.0</version.mockito>
        <version.junit-pioneer>2.3.0</version.junit-pioneer>
        <version.dss>6.0</version.dss>
        <version.bouncycastle>1.80</version.bouncycastle>
        <artefact.bouncycastle>jdk18on</artefact.bouncycastle>

        <skip.unittests/>

        <sonar.coverage.jacoco.xmlReportPaths>
            ${project.basedir}/../../bricks-integration-coverage/target/site/jacoco-aggregate/jacoco.xml,
            ${project.basedir}/../bricks-integration-coverage/target/site/jacoco-aggregate/jacoco.xml,
            ${project.basedir}/bricks-integration-coverage/target/site/jacoco-aggregate/jacoco.xml
        </sonar.coverage.jacoco.xmlReportPaths>
        <sonar.sources>src/main</sonar.sources>
        <sonar.exclusions>
            **/*Main.java,
            **/cli/cmd/*.java,
            **/cli/*App.java,
            **/gematik_schemes/**/*.xml,
            **/gematik_schemes/**/*.xsd,
        </sonar.exclusions>
    </properties>

    <url>https://github.com/gematik/lib-bbriccs</url>

    <scm>
        <url>https://github.com/gematik/lib-bbriccs</url>
        <connection>scm:git:git://github.com/gematik/lib-bbriccs.git</connection>
        <developerConnection>scm:git:ssh://git@github.com:gematik/lib-bbriccs.git
        </developerConnection>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/gematik/lib-bbriccs/issues</url>
    </issueManagement>

    <organization>
        <name>gematik GmbH</name>
        <url>https://www.gematik.de</url>
    </organization>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>gematik</name>
            <email>software-development@gematik.de</email>
            <url>https://gematik.github.io/</url>
            <organization>gematik GmbH</organization>
            <organizationUrl>https://www.gematik.de/</organizationUrl>
        </developer>
    </developers>

    <profiles>
        <profile>
            <id>publish</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.7</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.7.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

    <dependencyManagement>
        <dependencies>
            <!-- bricks dependencies -->
            <dependency>
                <groupId>de.gematik.bbriccs</groupId>
                <artifactId>fhir-bricks</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>de.gematik.bbriccs</groupId>
                <artifactId>restful-bricks</artifactId>
                <version>${project.version}</version>
            </dependency>
<!--            <dependency>-->
<!--                <groupId>de.gematik.bbriccs</groupId>-->
<!--                <artifactId>perimeter-bricks</artifactId>-->
<!--                <version>${project.version}</version>-->
<!--            </dependency>-->
            <dependency>
                <groupId>de.gematik.bbriccs</groupId>
                <artifactId>configuration-bricks</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>de.gematik.bbriccs</groupId>
                <artifactId>utility-bricks</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>de.gematik.bbriccs</groupId>
                <artifactId>fhir-test-examples-brick</artifactId>
                <version>${project.version}</version>
                <scope>test</scope>
                <type>jar</type>
            </dependency>
            <dependency>
                <groupId>de.gematik.bbriccs</groupId>
                <artifactId>resource-loader-brick</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>de.gematik.bbriccs</groupId>
                <artifactId>cli-tooling-bricks</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- common dependencies -->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${version.lombok}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.slf4j-api}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${version.logback}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${version.guava}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${version.fasterxml}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${version.fasterxml}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${version.fasterxml}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-xml</artifactId>
                <version>${version.fasterxml}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-yaml</artifactId>
                <version>${version.fasterxml}</version>
            </dependency>
            <dependency>
                <groupId>com.konghq</groupId>
                <artifactId>unirest-java-bom</artifactId>
                <version>4.4.5</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.github.javafaker</groupId>
                <artifactId>javafaker</artifactId>
                <version>${version.faker}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.yaml</groupId>
                        <artifactId>snakeyaml</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>one.util</groupId>
                <artifactId>streamex</artifactId>
                <version>${version.streamex}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${version.apache-commons-lang3}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.16.1</version>
            </dependency>
            <dependency>
                <groupId>info.picocli</groupId>
                <artifactId>picocli</artifactId>
                <version>4.7.5</version>
            </dependency>
            <!-- Dependencies for Test-Scope -->
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${version.junit}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${version.mockito}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit-pioneer</groupId>
                <artifactId>junit-pioneer</artifactId>
                <version>${version.junit-pioneer}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.wiremock</groupId>
                <artifactId>wiremock</artifactId>
                <version>3.3.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.codehaus.sonar-plugins.java</groupId>
                <artifactId>sonar-jacoco-listeners</artifactId>
                <version>3.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-test-junit</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <version>3.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit-pioneer</groupId>
            <artifactId>junit-pioneer</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.11</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-remote-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/kotlin</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.11.2</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-jar-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <excludes>
                        <exclude>**/logback.xml</exclude>
                        <exclude>**/logback-test.xml</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>jacoco-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.2.5</version>
                <configuration>
                    <argLine>@{argLine}</argLine>
                    <properties>
                        <property>
                            <name>listener</name>
                            <value>org.sonar.java.jacoco.JUnitListener</value>
                        </property>
                    </properties>
                    <skip>${skip.unittests}</skip>
                    <parallel>classes</parallel>
                    <runOrder>random</runOrder>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>2.41.1</version>
                <configuration>
                    <java>
                        <includes>
                            <include>**/src/main/java/**/*.java</include>
                            <include>**/src/test/java/**/*.java</include>
                        </includes>
                        <excludes>
                            <exclude>**/generated/**</exclude>
                        </excludes>
                        <licenseHeader>
                            <file>COPYRIGHT_HEADER</file>
                        </licenseHeader>
                        <googleJavaFormat>
                            <version>1.18.1</version>
                            <style>GOOGLE</style>
                            <reflowLongStrings>true</reflowLongStrings>
                            <formatJavadoc>true</formatJavadoc>
                        </googleJavaFormat>
                        <removeUnusedImports>
                            <engine>google-java-format</engine>
                        </removeUnusedImports>
                    </java>
                    <kotlin>
                        <includes>
                            <include>**/src/main/kotlin/**/*.kt</include>
                            <include>**/src/test/kotlin/**/*.kt</include>
                        </includes>
                        <ktlint>
                            <editorConfigOverride>
                                <indent_size>2</indent_size>
                            </editorConfigOverride>
                        </ktlint>
                        <licenseHeader>
                            <file>COPYRIGHT_HEADER</file>
                        </licenseHeader>
                    </kotlin>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.10.0</version>
                <reportSets>
                    <reportSet>
                        <id>non-aggregate</id>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                    <reportSet>
                        <id>aggregate</id>
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <distributionManagement>
        <repository>
            <id>releases</id>
            <url>${releaseDeploymentRepository}</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <url>${snapshotDeploymentRepository}</url>
        </snapshotRepository>
    </distributionManagement>

</project>