<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
<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">
    <parent>
        <groupId>org.kie.kogito</groupId>
        <artifactId>kogito-apps</artifactId>
        <version>999-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>kogito-apps-build-parent</artifactId>
    <packaging>pom</packaging>

    <name>Kogito Apps :: Build Parent BOM</name>

    <properties>
        <skip.springboot>false</skip.springboot>

        <failsafe.include>**/*IT.java</failsafe.include>
        <failsafe.exclude>**/Native*IT.java</failsafe.exclude>
        <tests.quarkus.http.port>0</tests.quarkus.http.port>

        <version.rename.plugin>1.0.1</version.rename.plugin>
        <version.frontend.plugin>1.12.1</version.frontend.plugin>
        <version.node>v18.16.0</version.node>
        <version.npm>6.10.3</version.npm>
        <version.pnpm>v8.7.0</version.pnpm>

        <!-- internal containers used for testing (built by maven using quarkus-container-image-jib) -->
        <container.image.explainability-service-messaging>org.kie.kogito/explainability-service-messaging:${project.version}</container.image.explainability-service-messaging>
        <container.image.jobs-service>org.kie.kogito/jobs-service-common:${project.version}</container.image.jobs-service>
        <container.image.data-index-service-postgresql>org.kie.kogito/data-index-service-postgresql:${project.version}</container.image.data-index-service-postgresql>
        <container.image.data-index-service-oracle>org.kie.kogito/data-index-service-oracle:${project.version}</container.image.data-index-service-oracle>
        <container.image.data-index-service-infinispan>org.kie.kogito/data-index-service-infinispan:${project.version}</container.image.data-index-service-infinispan>
        <container.image.data-index-service-mongodb>org.kie.kogito/data-index-service-mongodb:${project.version}</container.image.data-index-service-mongodb>
        <container.image.data-index-service-inmemory>org.kie.kogito/data-index-service-inmemory:${project.version}</container.image.data-index-service-inmemory>
        <container.image.trusty-service-infinispan>org.kie.kogito/trusty-service-infinispan:${project.version}</container.image.trusty-service-infinispan>
        <container.image.trusty-service>org.kie.kogito/trusty-service:${project.version}</container.image.trusty-service>
        <container.image.integration-tests-trusty-service-quarkus>org.kie.kogito/integration-tests-trusty-service-quarkus:${project.version}</container.image.integration-tests-trusty-service-quarkus>

        <!-- OptaPlanner version -->
        <version.org.optaplanner>${project.version}</version.org.optaplanner>

        <version.org.hibernate>7.1.14.Final</version.org.hibernate>
        <version.org.apache.opennlp>2.3.2</version.org.apache.opennlp>
        <version.org.apache.commons.csv>1.10.0</version.org.apache.commons.csv>
        <version.org.jredisearch>2.2.0</version.org.jredisearch>

        <version.org.json>20231013</version.org.json>
        <version.org.mapstruct>1.5.5.Final</version.org.mapstruct>
        <version.org.skyscreamer>1.5.1</version.org.skyscreamer>
        <!-- graphql-java upgraded from 22.0 to 24.3 for java-dataloader 3.4.0+ compatibility
             required by Spring Boot 3.5.x (DataLoaderOptions.newDefaultOptions()).
             extended-scalars version must match graphql-java major version. -->
        <version.com.graphql-java>24.3</version.com.graphql-java>
        <version.com.graphql-java-extended-scalars>24.0</version.com.graphql-java-extended-scalars>

        <!-- Explainability Toolkit version -->
        <version.explainability-core>1.22.1.Final</version.explainability-core>

        <!-- Mutiny Zero Flow Adapters -->
        <version.io.smallrye.reactive.mutiny-zero>1.1.1</version.io.smallrye.reactive.mutiny-zero>
        <version.drools.util>${project.version}</version.drools.util>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.coderplus.maven.plugins</groupId>
                    <artifactId>copy-rename-maven-plugin</artifactId>
                    <version>${version.rename.plugin}</version>
                </plugin>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>${version.frontend.plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <configuration>
                        <includes>
                            <include>${failsafe.include}</include>
                        </includes>
                        <excludes>
                            <exclude>${failsafe.exclude}</exclude>
                        </excludes>
                        <systemPropertyVariables>
                            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                            <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                            <container.image.infinispan>${container.image.infinispan}</container.image.infinispan>
                            <container.image.keycloak>${container.image.keycloak}</container.image.keycloak>
                            <container.image.kafka>${container.image.kafka}</container.image.kafka>
                            <container.image.redis>${container.image.redis}</container.image.redis>
                            <container.image.data-index-service-postgresql>${container.image.data-index-service-postgresql}</container.image.data-index-service-postgresql>
                            <container.image.data-index-service-oracle>${container.image.data-index-service-oracle}</container.image.data-index-service-oracle>
                            <container.image.data-index-service-inmemory>${container.image.data-index-service-inmemory}</container.image.data-index-service-inmemory>
                            <container.image.data-index-service-infinispan>${container.image.data-index-service-infinispan}</container.image.data-index-service-infinispan>
                            <container.image.data-index-service-mongodb>${container.image.data-index-service-mongodb}</container.image.data-index-service-mongodb>
                            <container.image.jobs-service>${container.image.jobs-service}</container.image.jobs-service>
                            <container.image.explainability-service-messaging>${container.image.explainability-service-messaging}</container.image.explainability-service-messaging>
                            <container.image.trusty-service-infinispan>${container.image.trusty-service-infinispan}</container.image.trusty-service-infinispan>
                            <quarkus.http.test-port>${tests.quarkus.http.port}</quarkus.http.test-port>
                        </systemPropertyVariables>
                        <classesDirectory>${project.build.outputDirectory}</classesDirectory>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <systemPropertyVariables>
                            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                            <container.image.kafka>${container.image.kafka}</container.image.kafka>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>
            <!-- Override Hibernate version before BOM imports (first-wins) -->
            <dependency>
                <groupId>org.hibernate.orm</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>${version.org.hibernate}</version>
            </dependency>
            <dependency>
                <groupId>org.kie.kogito</groupId>
                <artifactId>kogito-quarkus-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.kie.kogito</groupId>
                <artifactId>kogito-apps-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.optaplanner</groupId>
                <artifactId>optaplanner-quarkus</artifactId>
                <version>${version.org.optaplanner}</version>
            </dependency>
            <dependency>
                <groupId>com.redislabs</groupId>
                <artifactId>jredisearch</artifactId>
                <version>${version.org.jredisearch}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.json</groupId>
                        <artifactId>json</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
                <version>${version.org.json}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-csv</artifactId>
                <version>${version.org.apache.commons.csv}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.opennlp</groupId>
                <artifactId>opennlp-tools</artifactId>
                <version>${version.org.apache.opennlp}</version>
            </dependency>
            <dependency>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct</artifactId>
                <version>${version.org.mapstruct}</version>
            </dependency>
            <dependency>
                <groupId>io.smallrye.reactive</groupId>
                <artifactId>mutiny-zero-flow-adapters</artifactId>
                <version>${version.io.smallrye.reactive.mutiny-zero}</version>
            </dependency>
            <dependency>
                <groupId>org.skyscreamer</groupId>
                <artifactId>jsonassert</artifactId>
                <version>${version.org.skyscreamer}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hibernate.orm</groupId>
                <artifactId>hibernate-ant</artifactId>
                <version>${version.org.hibernate}</version>
            </dependency>
            <dependency>
                <groupId>com.graphql-java</groupId>
                <artifactId>graphql-java</artifactId>
                <version>${version.com.graphql-java}</version>
            </dependency>
            <dependency>
                <groupId>com.graphql-java</groupId>
                <artifactId>graphql-java-extended-scalars</artifactId>
                <version>${version.com.graphql-java-extended-scalars}</version>
            </dependency>
            <dependency>
                <groupId>org.kie.kogito</groupId>
                <artifactId>explainability-core</artifactId>
                <version>${version.explainability-core}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <profiles>
        <profile>
            <id>native</id>
            <activation>
                <property>
                    <name>native</name>
                </property>
            </activation>
            <properties>
                <skip.springboot>true</skip.springboot>
                <failsafe.include>**/Native*IT.java</failsafe.include>
                <failsafe.exclude></failsafe.exclude>
                <quarkus.native.native-image-xmx>8g</quarkus.native.native-image-xmx>
                <!-- Native building needs a fixed port for tests -->
                <tests.quarkus.http.port>8080</tests.quarkus.http.port>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-failsafe-plugin</artifactId>
                            <configuration>
                                <excludes>
                                    <exclude>**/Keycloak*IT.java</exclude>
                                </excludes>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>quickly</id>
            <activation>
                <property>
                    <name>quickly</name>
                </property>
            </activation>
            <properties>
                <skip.springboot>true</skip.springboot>
                <formatter.skip>true</formatter.skip>
                <skipITs>true</skipITs>
                <skipTests>true</skipTests>
                <enforcer.skip>true</enforcer.skip>
                <checkstyle.skip>true</checkstyle.skip>
                <quarkus.build.image>false</quarkus.build.image>
                <docker.skip>true</docker.skip>
            </properties>
        </profile>
    </profiles>
</project>
