/**
 * 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.
 */
apply plugin: 'io.spring.dependency-management'

// Configuration for the dependency management plugin
// https://github.com/spring-gradle-plugins/dependency-management-plugin
dependencyManagement {
    imports {
        mavenBom 'com.squareup.okhttp3:okhttp-bom:4.12.0'
        mavenBom 'org.slf4j:slf4j-bom:2.0.17'
        mavenBom 'io.micrometer:micrometer-bom:1.13.6'
        mavenBom 'org.springframework.boot:spring-boot-dependencies:3.5.5'
        mavenBom 'io.awspring.cloud:spring-cloud-aws-dependencies:3.2.1'
        mavenBom 'io.opentelemetry:opentelemetry-bom:1.44.1'
        mavenBom 'org.jetbrains.kotlin:kotlin-bom:2.0.21'
        mavenBom 'org.junit:junit-bom:5.11.3'
        mavenBom 'com.fasterxml.jackson:jackson-bom:2.18.3'
        mavenBom 'io.cucumber:cucumber-bom:7.20.1'
        mavenBom 'org.mockito:mockito-bom:5.14.2'
        mavenBom 'software.amazon.awssdk:bom:2.29.9'
        mavenBom 'io.github.resilience4j:resilience4j-bom:2.2.0'
        mavenBom 'org.testcontainers:testcontainers-bom:1.20.4'
        mavenBom 'org.glassfish.jersey:jersey-bom:3.1.10'
    }

    dependencies {
        // We use fixed versions, instead of inheriting them from the Spring BOM, to be able to be on more recent ones.
        // We do not use :+ to get the latest available version available on Maven Central, as that could suddenly break things.
        // We use the Renovate Bot to automatically propose Pull Requests (PRs) when upgrades for all of these versions are available.

        dependency 'ch.qos.logback:logback-core:1.5.17'
        dependency 'ch.qos.logback:logback-classic:1.5.17'
        dependency 'ch.qos.logback.contrib:logback-json-classic:0.1.5'
        dependency 'ch.qos.logback.contrib:logback-jackson:0.1.5'
        dependency 'org.codehaus.janino:janino:3.1.12'

        dependency 'org.eclipse.persistence:org.eclipse.persistence.jpa:4.0.2'
        dependency 'com.google.guava:guava:33.1.0-jre'
        dependency 'com.google.code.gson:gson:2.11.0'
        dependency 'com.google.googlejavaformat:google-java-format:1.24.0'
        dependency 'org.apache.commons:commons-collections4:4.4'
        dependency 'org.apache.commons:commons-compress:1.26.0'
        dependency ('software.amazon.msk:aws-msk-iam-auth:2.2.0') {
            exclude 'commons-logging:commons-logging:'
        }
        dependency ('org.apache.commons:commons-email:1.6.0') {
            exclude 'com.sun.mail:javax.mail'
            exclude 'javax.activation:activation'
        }
        dependency 'commons-io:commons-io:2.18.0'
        dependency 'com.github.librepdf:openpdf:2.0.3'
        dependency ('org.mnode.ical4j:ical4j:3.2.19') {
            exclude 'com.sun.mail:javax.mail'
            exclude 'org.codehaus.groovy:groovy'
        }
        dependency 'org.apache.commons:commons-csv:1.12.0'
        dependency 'org.quartz-scheduler:quartz:2.5.0'
        dependency 'org.ehcache:ehcache:3.10.8'
        dependency 'com.github.spullara.mustache.java:compiler:0.9.14'
        dependency 'com.jayway.jsonpath:json-path:2.9.0'
        dependency ('org.apache.tika:tika-core:2.9.3') {
            exclude 'commons-logging:commons-logging'
        }
        dependency ('org.apache.tika:tika-core:2.9.3') {
            exclude 'commons-logging:commons-logging'
        }
        dependency ('org.apache.tika:tika-parser-miscoffice-module:2.9.3') {
            exclude 'org.bouncycastle:bcprov-jdk15on'
            exclude 'org.bouncycastle:bcmail-jdk15on'
            exclude 'org.bouncycastle:bcprov-jdk18on'
            exclude 'org.bouncycastle:bcmail-jdk18on'
            exclude 'commons-logging:commons-logging'
            exclude 'org.apache.logging.log4j:log4j-api'
            exclude 'org.slf4j:slf4j-api'
            exclude 'commons-io:commons-io'
            exclude 'commons-codec:commons-codec'
            exclude 'org.apache.commons:commons-lang3'
            exclude 'org.apache.poi:poi'
            exclude 'org.apache.poi:poi-scratchpad'
            exclude 'org.glassfish.jaxb:jaxb-runtime'
            exclude 'org.apache.commons:commons-compress'
            exclude 'xml-apis:xml-apis'
        }
        dependency ('org.apache.tika:tika-parser-microsoft-module:2.9.3') {
            exclude 'org.bouncycastle:bcprov-jdk15on'
            exclude 'org.bouncycastle:bcmail-jdk15on'
            exclude 'org.bouncycastle:bcprov-jdk18on'
            exclude 'org.bouncycastle:bcmail-jdk18on'
            exclude 'commons-logging:commons-logging'
            exclude 'org.apache.logging.log4j:log4j-api'
            exclude 'org.slf4j:slf4j-api'
            exclude 'commons-io:commons-io'
            exclude 'commons-codec:commons-codec'
            exclude 'org.apache.commons:commons-lang3'
            exclude 'org.apache.poi:poi'
            exclude 'org.apache.poi:poi-scratchpad'
            exclude 'org.glassfish.jaxb:jaxb-runtime'
            exclude 'org.apache.commons:commons-compress'
            exclude 'xml-apis:xml-apis'
        }
        dependency ('org.apache.httpcomponents:httpclient:4.5.14') {
            exclude 'commons-logging:commons-logging:'
        }
        dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4'
        dependency 'jakarta.jms:jakarta.jms-api:3.1.0'
        dependency 'jakarta.ws.rs:jakarta.ws.rs-api:3.1.0'
        dependency 'org.glassfish.jaxb:jaxb-runtime:2.3.6' // Swagger needs exactly this version
        dependency 'joda-time:joda-time:2.13.1'

        dependency 'io.github.classgraph:classgraph:4.8.179'
        dependency 'org.awaitility:awaitility:4.2.2'
        dependency 'com.github.spotbugs:spotbugs-annotations:4.8.6'
        dependency 'javax.cache:cache-api:1.1.1'
        dependency 'org.mock-server:mockserver-junit-jupiter:5.15.0'
        dependency 'org.webjars:webjars-locator-core:0.59'
        dependency 'com.icegreen:greenmail-junit5:2.0.1'

        // fineract client dependencies
        dependency "com.squareup.retrofit2:retrofit:2.11.0"
        dependency "com.squareup.retrofit2:retrofit-mock:2.11.0"
        dependency "com.squareup.retrofit2:adapter-java8:2.11.0"
        dependency "com.squareup.retrofit2:adapter-rxjava2:2.11.0"
        dependency "com.squareup.retrofit2:adapter-rxjava3:2.11.0"
        dependency "com.squareup.retrofit2:adapter-guava:2.11.0"
        dependency "com.squareup.retrofit2:converter-wire:2.11.0"
        dependency "com.squareup.retrofit2:converter-jackson:2.11.0"
        dependency "com.squareup.retrofit2:converter-simplexml:2.11.0"
        dependency "com.squareup.retrofit2:converter-jaxb:2.11.0"
        dependency "com.squareup.retrofit2:converter-java8:2.11.0"
        dependency "com.squareup.retrofit2:converter-scalars:2.11.0"
        dependency "com.squareup.retrofit2:converter-gson:2.11.0"
        dependency "com.squareup.retrofit2:converter-protobuf:2.11.0"
        dependency 'io.reactivex.rxjava2:rxjava:2.2.21'
        dependency "io.gsonfire:gson-fire:1.9.0"
        dependency "com.google.code.findbugs:jsr305:3.0.2"
        dependency "commons-codec:commons-codec:1.17.1"
        dependency "org.projectlombok:lombok:1.18.36"

        dependency 'org.bouncycastle:bcpkix-jdk18on:1.80'
        dependency 'org.bouncycastle:bcprov-jdk18on:1.80'
        dependency 'org.bouncycastle:bcutil-jdk18on:1.80'
        dependency 'org.bouncycastle:bcpg-jdk18on:1.80'

        dependency 'org.eclipse.jgit:org.eclipse.jgit:7.2.0.202503040940-r'
        dependency 'org.eclipse.jgit:org.eclipse.jgit.gpg.bc:7.2.0.202503040940-r'
        dependency 'org.eclipse.jgit:org.eclipse.jgit.ssh.apache:7.2.0.202503040940-r'

        dependency ('com.tmatesoft.svnkit:svnkit:1.10.12')
        dependency 'com.vdurmont:semver4j:3.1.0'
        dependency 'org.beryx:text-io:3.4.1'

        dependency ('org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0') {
            exclude 'io.swagger.core.v3:swagger-core'
        }

        dependency 'com.google.cloud.sql:mysql-socket-factory-connector-j-8:1.23.1'

        dependency ('org.apache.activemq:activemq-client:6.1.6') {
            exclude 'javax.annotation:javax.annotation-api'
        }

        dependency 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.22'
        dependency ('io.swagger.core.v3:swagger-jaxrs2-jakarta:2.2.22') {
            exclude 'jakarta.activation:jakarta.activation-api'
        }
        dependency ('io.swagger.core.v3:swagger-core-jakarta:2.2.22') {
            exclude 'jakarta.activation:jakarta.activation-api'
        }

        dependency 'jakarta.annotation:jakarta.annotation-api:3.0.0'
        dependency 'jakarta.activation:jakarta.activation-api:2.1.3'
        dependency ('com.sun.mail:jakarta.mail:2.0.1') {
            // Spring needs this version
            exclude 'com.sun.activation:jakarta.activation'
        }
        dependency ('jakarta.xml.bind:jakarta.xml.bind-api:4.0.2') {
            exclude 'jakarta.activation:jakarta.activation-api'
        }
        dependency 'jakarta.validation:jakarta.validation-api:3.1.1'
        dependency 'org.hibernate.validator:hibernate-validator:9.0.1.Final'

        dependency ('org.liquibase:liquibase-core:4.31.1') {
            exclude 'javax.xml.bind:jaxb-api'
        }
        dependency 'org.liquibase.ext:liquibase-postgresql:4.31.1'

        dependency ('org.dom4j:dom4j:2.1.4') {
            exclude 'relaxngDatatype:relaxngDatatype' // already in com.sun.xml.bind:jaxb-osgi:2.3.0.1
            // FINERACT-940 && FINERACT-966 https://github.com/spotbugs/spotbugs/issues/1128
            exclude 'xpp3:xpp3'
            exclude 'pull-parser:pull-parser'
        }

        dependency 'org.owasp.esapi:esapi:2.7.0.0'
        dependency 'org.awaitility:awaitility:4.2.2'

        dependencySet(group: 'org.apache.poi', version: '5.4.1') {
            entry 'poi'
            entry 'poi-ooxml'
            entry 'poi-ooxml-schemas'
        }

        dependencySet(group: 'io.rest-assured', version: '5.5.1') {
            entry 'rest-assured'
            entry 'json-path'
            entry 'xml-path'
        }
        dependency 'org.apache.groovy:groovy-xml:4.0.26'
        dependency 'org.apache.groovy:groovy-json:4.0.26'

        dependency 'org.mapstruct:mapstruct:1.6.3'
        dependency 'org.mapstruct:mapstruct-processor:1.6.3'

        dependency "org.apache.avro:avro:1.12.0"

        dependency ('org.mariadb.jdbc:mariadb-java-client:3.5.2') {
            exclude 'org.slf4j:jcl-over-slf4j'
            exclude 'org.slf4j:slf4j-api'
        }
        dependency 'org.postgresql:postgresql:42.7.8'

        dependency 'com.mysql:mysql-connector-j:9.2.0'

        dependency 'org.assertj:assertj-core:3.26.3'

        dependency 'org.apache.commons:commons-math3:3.6.1'
        dependency 'commons-beanutils:commons-beanutils:1.11.0'

        dependency 'org.mockito:mockito-inline:5.2.0'

        dependency 'org.wiremock:wiremock-standalone:3.13.0'
        dependency 'org.apache.sshd:sshd-common:2.15.0'
        dependency 'org.apache.sshd:sshd-core:2.15.0'

        dependency 'io.cucumber:cucumber-java:7.20.1'
        dependency 'io.cucumber:cucumber-java8:7.20.1'
        dependency 'io.cucumber:cucumber-junit-platform-engine:7.20.1'
        dependency 'io.cucumber:cucumber-spring:7.20.1'

        dependency 'org.reflections:reflections:0.10.2'

        dependency 'org.openjdk.jmh:jmh-core:1.37'
        dependency 'org.openjdk.jmh:jmh-generator-annprocess:1.37'

        dependency 'org.springframework.restdocs:spring-restdocs-asciidoctor:3.0.3'
        dependency 'org.springframework.restdocs:spring-restdocs-mockmvc:3.0.3'
        dependency 'org.springframework.restdocs:spring-restdocs-webtestclient:3.0.3'
        dependency 'org.springframework.restdocs:spring-restdocs-restassured:3.0.3'

        dependency 'com.lmax:disruptor:3.4.4'

        dependency 'com.ibm.icu:icu4j:76.1'
        dependency 'org.yakworks:spring-icu4j:0.4.2'
        dependency 'org.apache.commons:commons-lang3:3.18.0'
        dependency 'com.nimbusds:nimbus-jose-jwt:10.0.2'
        // Force Spring Framework version: CVE-2025-41249
        dependency 'org.springframework:spring-core:6.2.11'
        // Force Spring Framework version: CVE-2025-41248
        dependency 'org.springframework.security:spring-security-core:6.5.4'
        // Force netty-codec version: CVE-2025-58057
        dependency 'io.netty:netty-codec:4.1.125.Final'
        // Force netty-codec version: CVE-2025-58056
        dependency 'io.netty:netty-codec-http:4.1.125.Final'
    }
}
