<?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>

    <artifactId>zerocode-tdd-parent</artifactId>
    <groupId>org.jsmart</groupId>
    <version>1.4.1</version>

    <packaging>pom</packaging>
    <name>ZeroCode TDD Parent</name>
    <description>zerocode tdd parent</description>
    <url>http://www.jsmart.org</url>
    <licenses>
        <license>
            <name>The Apache2 License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/authorjapps/zerocode</url>
        <connection>scm:git:git@github.com:authorjapps/zerocode.git</connection>
        <developerConnection>scm:git:git@github.com:authorjapps/zerocode.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <modules>
        <module>core</module>
        <module>http-testing-examples</module>
        <module>kafka-testing-examples</module>
        <module>junit5-testing-examples</module>
        <module>zerocode-maven-archetype</module>
    </modules>

    <developers>
        <developer>
            <id>authorjapps</id>
            <name>jApps</name>
            <email>author.japps@gmail.com</email>
            <url>https://github.com/authorjapps/zerocode</url>
            <organization>jSmart</organization>
            <organizationUrl>http://www.jsmart.org</organizationUrl>
        </developer>
    </developers>

    <properties>
        <!-- This project properties -->
        <junit5.version>5.11.3</junit5.version>
        <junit.vintage.version>5.7.0</junit.vintage.version>
        <junit-platform-runner.version>1.4.2</junit-platform-runner.version>
        <junit.version>4.13.2</junit.version>
        <mockito.version>4.11.0</mockito.version>
        <jackson.version>2.15.4</jackson.version>
        <guava.version>33.0.0-jre</guava.version>
        <jsonassert.version>1.5.1</jsonassert.version>
        <classpath-explorer.version>1.0</classpath-explorer.version>

        <guice.version>7.0.0</guice.version>
        <jayway-version>2.9.0</jayway-version>
        <json-smart.version>2.5.0</json-smart.version>
        <!-- resteasy 4.7.0.Final needs JDK11 -->
        <resteasy-jaxrs.version>3.15.6.Final</resteasy-jaxrs.version>
        <!-- logback 1.4.x and 1.5.x need JDK11 -->
        <logback.version>1.3.14</logback.version>
        <slf4j.version>2.0.12</slf4j.version>
        <!-- wiremock 3.x needs JDK 11 -->
        <wiremock.version>2.27.2</wiremock.version>
        <commons-io.version>2.15.0</commons-io.version>
        <commons-collections4.version>4.4</commons-collections4.version>
        <commons-lang3.version>3.14.0</commons-lang3.version>
        <commons-text.version>1.11.0</commons-text.version>
        <commons-dbutils.version>1.8.1</commons-dbutils.version>
        <micro-simulator.version>1.1.10</micro-simulator.version>
        <httpclient.version>4.5.13</httpclient.version>
        <httpmime.version>4.5.12</httpmime.version>
        <h2.db.version>2.2.220</h2.db.version>
        <postgres.db.version>42.7.4</postgres.db.version>
        <extentreports.version>5.0.9</extentreports.version>
        <version.kafka-clients>3.7.0</version.kafka-clients>
        <version.gson>2.10.1</version.gson>

        <!-- Maven plugins, build properties  -->
        <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
        <java-compiler-source.version>1.8</java-compiler-source.version>
        <java-compiler-target.version>1.8</java-compiler-target.version>
        <maven-assembly-plugin.version>3.6.0</maven-assembly-plugin.version>
        <maven-source-plugin.version>3.3.0</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.6.0</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
        <maven-release-plugin.version>3.0.1</maven-release-plugin.version>
        <maven-surefire-plugin.version>3.2.1</maven-surefire-plugin.version>
        <maven-dependency-plugin.version>3.6.1</maven-dependency-plugin.version>

        <!-- Release Build will not fail if error occurs during javadoc generation -->
        <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
        <google.protobuf.version>3.24.4</google.protobuf.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit5.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit5.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.junit.vintage</groupId>
                        <artifactId>junit-vintage-engine</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!-- The junit 4 test engine implementation. -->
            <dependency>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
                <version>${junit.vintage.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-runner</artifactId>
                <version>${junit-platform-runner.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version> <!-- Use 5.14.2 if on Java 11+ compiler -->
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${version.gson}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka-clients</artifactId>
                <version>${version.kafka-clients}</version>
            </dependency>
            <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
                <version>20240205</version>
            </dependency>
            <dependency>
                <groupId>org.apache.velocity</groupId>
                <artifactId>velocity-engine-core</artifactId>
                <version>2.3</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-yaml</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-csv</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.tomakehurst</groupId>
                <artifactId>wiremock</artifactId>
                <version>${wiremock.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>resteasy-jaxrs</artifactId>
                <version>${resteasy-jaxrs.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>resteasy-client</artifactId>
                <version>${resteasy-jaxrs.version}</version>
            </dependency>

            <dependency>
                <groupId>com.jayway.jsonpath</groupId>
                <artifactId>json-path</artifactId>
                <version>${jayway-version}</version>
            </dependency>

            <dependency>
                <groupId>com.google.classpath-explorer</groupId>
                <artifactId>classpath-explorer</artifactId>
                <version>${classpath-explorer.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <version>${guice.version}</version>
            </dependency>
            <dependency>
                <groupId>org.skyscreamer</groupId>
                <artifactId>jsonassert</artifactId>
                <version>${jsonassert.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jdk8</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <!--<scope>test</scope>--> <!-- added with compile scope. Do not change this -->
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${httpclient.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpmime</artifactId>
                <version>${httpmime.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-collections4</artifactId>
                <version>${commons-collections4.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>${commons-text.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jsmart</groupId>
                <artifactId>micro-simulator</artifactId>
                <version>${micro-simulator.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>commons-dbutils</groupId>
                <artifactId>commons-dbutils</artifactId>
                <version>${commons-dbutils.version}</version>
            </dependency>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>${h2.db.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>${postgres.db.version}</version>
            </dependency>
            <dependency>
                <groupId>com.aventstack</groupId>
                <artifactId>extentreports</artifactId>
                <version>${extentreports.version}</version> <!-- extent community version -->
            </dependency>
            <!-- https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java -->
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>${google.protobuf.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java-util</artifactId>
                <version>${google.protobuf.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!--
     - Commented to avoid javadoc error during maven release to Nexus central.
     - Uncomment this only when needed or if any other module dependent on this section
     - Check, if the CI build is fine, no need to uncomment this section.
     -
     - How to check or reproduce this javadoc error?
     - From your local laptop
     - Option-1 : Run a maven "dry run" <- Results in error e.g. javadoc error due to JAVA_HOME not set - Option-2 : Run a maven "prepare" run <- Results in error e.g. javadoc error due to JAVA_HOME not set - - Note: or remove the specific plugins from the build section and try dry-run and prepare stages, if full "commenting out" has issues -->

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${java-compiler-source.version}</source>
                        <target>${java-compiler-target.version}</target>
                        <compilerArgs>
                            <arg>-proc:none</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <!--<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-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.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-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                </plugin>
                <!--<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                </plugin>-->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.4.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                    <waitUntil>published</waitUntil>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <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>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <failOnError>false</failOnError>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>

        <profile>
            <!--
                Compiler strategy for Java 8 bytecode target:
                - JDK 8 / 11 : uses "-source 1.8 -target 1.8" (set in pluginManagement above).
                                "- - release" is not supported on JDK 8, and JDK 11 is non-LTS / low
                                adoption, so the legacy flags are acceptable there.
                - JDK 17+    : adds "maven.compiler.release=8", which is strictly safer — it enforces
                                both the language level AND the Java 8 API surface, preventing code
                                that compiles on JDK 17 but would fail at runtime on JDK 8.
                                JDK 17, 21, and 23 are the LTS versions most users actually run, so
                                this is where the stricter check matters most.
                No separate jdk-9plus profile is needed: JDK 9/10 are non-LTS, end-of-life, and
                absent from the CI matrix, so there is nothing to guard there.
            -->
            <id>jdk-17plus</id>
            <activation>
                <jdk>[17,)</jdk>
            </activation>
            <properties>
                <java.version>17</java.version>
                <maven.compiler.release>8</maven.compiler.release>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven-surefire-plugin.version}</version>
                        <configuration>
                            <argLine>
                                --add-opens java.base/java.lang=ALL-UNNAMED
                                --add-opens java.base/java.lang.reflect=ALL-UNNAMED
                            </argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>
</project>