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

    <parent>
        <groupId>io.quarkiverse</groupId>
        <artifactId>quarkiverse-parent</artifactId>
        <version>26</version>
    </parent>
    <groupId>io.quarkiverse.flow</groupId>
    <artifactId>quarkus-flow-parent</artifactId>
    <version>1.2.0</version>
    <packaging>pom</packaging>
    <name>Quarkus Flow :: Parent</name>

    <modules>
        <module>oidc</module>
        <module>core</module>
        <module>messaging</module>
        <module>langchain4j</module>
        <module>grpc</module>
        <module>persistence</module>
        <module>durable-kubernetes</module>
        <module>scheduler</module>
        <module>bom</module>
        <module>quarkus-platform-checks</module>
        <module>runner</module>
        <module>docs-rag</module>
        <module>opentelemetry</module>
    </modules>

    <scm>
        <connection>scm:git:git@github.com:quarkiverse/quarkus-flow.git</connection>
        <developerConnection>scm:git:git@github.com:quarkiverse/quarkus-flow.git</developerConnection>
        <url>https://github.com/quarkiverse/quarkus-flow</url>
        <tag>1.2.0</tag>
    </scm>

    <properties>
        <compiler-plugin.version>3.16.0</compiler-plugin.version>
        <maven.compiler.release>17</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <quarkus.log.level>OFF</quarkus.log.level>

        <quarkus.version>3.39.0</quarkus.version>
        <jandex.version>3.6.0</jandex.version>
        <io.serverlessworkflow.version>7.35.3.Final</io.serverlessworkflow.version>
        <io.cloudevents.version>5.0.0</io.cloudevents.version>

        <io.quarkiverse.jackson-jq.version>2.6.1</io.quarkiverse.jackson-jq.version>
        <com.github.zafarkhaja.version>0.10.2</com.github.zafarkhaja.version>
        <io.quarkiverse.langchain4j.version>1.14.1</io.quarkiverse.langchain4j.version>

        <!-- Tests and Docs -->
        <org.assertj.version>3.27.7</org.assertj.version>
        <quarkus-antora.version>3.40.0</quarkus-antora.version>
        <version.org.jacoco>0.8.15</version.org.jacoco>
        <io.quarkiverse.playwright>2.3.10</io.quarkiverse.playwright>
        <com.h2database.version>2.5.252</com.h2database.version>
        <org.wiremock.version>3.13.2</org.wiremock.version>

        <version.plugin.build.reporter.maven.extension>3.13.1</version.plugin.build.reporter.maven.extension>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-bom</artifactId>
                <version>${quarkus.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-junit-component</artifactId>
                <version>${quarkus.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.serverlessworkflow</groupId>
                <artifactId>serverlessworkflow-bom</artifactId>
                <version>${io.serverlessworkflow.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.quarkiverse.jackson-jq</groupId>
                <artifactId>quarkus-jackson-jq</artifactId>
                <version>${io.quarkiverse.jackson-jq.version}</version>
            </dependency>
            <dependency>
                <groupId>io.quarkiverse.jackson-jq</groupId>
                <artifactId>quarkus-jackson-jq-deployment</artifactId>
                <version>${io.quarkiverse.jackson-jq.version}</version>
            </dependency>
            <dependency>
                <groupId>io.cloudevents</groupId>
                <artifactId>cloudevents-json-jackson</artifactId>
                <version>${io.cloudevents.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.zafarkhaja</groupId>
                <artifactId>java-semver</artifactId>
                <version>${com.github.zafarkhaja.version}</version>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${org.assertj.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2-mvstore</artifactId>
                <version>${com.h2database.version}</version>
            </dependency>
            <dependency>
                <groupId>org.wiremock</groupId>
                <artifactId>wiremock</artifactId>
                <version>${org.wiremock.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <extensions>
            <extension>
                <groupId>io.quarkus.bot</groupId>
                <artifactId>build-reporter-maven-extension</artifactId>
                <version>${version.plugin.build.reporter.maven.extension}</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-maven-plugin</artifactId>
                    <version>${quarkus.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${compiler-plugin.version}</version>
                    <configuration>
                        <parameters>true</parameters>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-config-doc-maven-plugin</artifactId>
                    <version>${quarkus.version}</version>
                </plugin>
                <plugin>
                    <groupId>io.smallrye</groupId>
                    <artifactId>jandex-maven-plugin</artifactId>
                    <version>${jandex.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>format-code</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Import sorter -->
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>sort-imports</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>sort</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>check-imports</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>docs</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>!true</value>
                </property>
            </activation>
            <modules>
                <module>docs</module>
                <module>examples</module>
            </modules>
        </profile>
        <profile>
            <id>code-coverage</id>

            <dependencies>
                <dependency>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-jacoco</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.mockito</groupId>
                    <artifactId>mockito-core</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${version.org.jacoco}</version>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <destFile>${maven.multiModuleProjectDirectory}/target/jacoco-quarkus.exec</destFile>
                                    <append>true</append>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <quarkus.jacoco.data-file>
                                    ${maven.multiModuleProjectDirectory}/target/jacoco-quarkus.exec
                                </quarkus.jacoco.data-file>
                                <quarkus.jacoco.reuse-data-file>true</quarkus.jacoco.reuse-data-file>
                                <quarkus.jacoco.report-location>
                                    ${maven.multiModuleProjectDirectory}/target/jacoco-report
                                </quarkus.jacoco.report-location>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>integration-tests</id>
            <activation>
                <property>
                    <name>skipITs</name>
                    <value>false</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <argLine>@{argLine} -Xmx1024m</argLine>
                            <systemPropertyVariables>
                                <native.image.path>${project.build.directory}/${project.build.finalName}-runner
                                </native.image.path>
                                <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                                <maven.home>${maven.home}</maven.home>
                                <quarkus.log.level>OFF</quarkus.log.level>
                                <quarkus.banner.enabled>false</quarkus.banner.enabled>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
