<%#
 Copyright 2013-2019 the original author or authors from the JHipster project.

 This file is part of the JHipster project, see https://www.jhipster.tech/
 for more information.

 Licensed 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.
-%>
buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
        gradlePluginPortal()
        maven { url "http://repo.spring.io/plugins-release" }
    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${spring_boot_version}"
        classpath "io.spring.gradle:propdeps-plugin:0.0.10.RELEASE"
        <%_ if (enableSwaggerCodegen) { _%>
        classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.4"
        <%_ } _%>
        //jhipster-needle-gradle-buildscript-dependency - JHipster will add additional gradle build script plugins here
    }
}

plugins {
    id "java"
    id "maven"
    id "war"
    id "idea"
    id "jacoco"
    id "com.google.cloud.tools.jib" version "0.9.11"
    id "com.gorylenko.gradle-git-properties" version "2.0.0"
    <%_ if (!skipClient) { _%>
    id "com.github.node-gradle.node" version "1.3.0"
    <%_ } _%>
    id "net.ltgt.apt-eclipse" version "0.21"
    id "net.ltgt.apt-idea" version "0.21"
    id "net.ltgt.apt" version "0.21"
    <%_ if (databaseType === 'sql') { _%>
    id "org.liquibase.gradle" version "2.0.1"
    <%_ } _%>
    id "org.sonarqube" version "2.7"
    //jhipster-needle-gradle-plugins - JHipster will add additional gradle plugins here
}

sourceCompatibility=<%= JAVA_VERSION %>
targetCompatibility=<%= JAVA_VERSION %>
assert System.properties["java.specification.version"] == "1.8" || "11" || "12"

apply plugin: "org.springframework.boot"
apply plugin: "propdeps"

apply from: "gradle/docker.gradle"
apply from: "gradle/sonar.gradle"
<%_ if (enableSwaggerCodegen) { _%>
apply from: "gradle/swagger.gradle"
<%_ } _%>
//jhipster-needle-gradle-apply-from - JHipster will add additional gradle scripts to be applied here

if (project.hasProperty("prod")) {
    apply from: "gradle/profile_prod.gradle"
} else {
    apply from: "gradle/profile_dev.gradle"
}

<%_ if (serviceDiscoveryType || applicationType === 'gateway' || applicationType === 'microservice' || applicationType === 'uaa') { _%>
if (project.hasProperty("zipkin")) {
    apply from: "gradle/zipkin.gradle"
}
<%_ } _%>

idea {
    module {
        excludeDirs += files("node_modules")
    }
}

eclipse {
    sourceSets {
        main {
            java {
                srcDirs += ["build/generated/source/apt/main"]
            }
        }
    }
}

defaultTasks "bootRun"

group = "<%= packageName %>"
version = "0.0.1-SNAPSHOT"

description = ""

bootWar {
    mainClassName = "<%= packageName %>.<%= mainClass %>"
    includes = ["WEB-INF/**", "META-INF/**"]
}

war {
    <%_ if (!skipClient) { _%>
    webAppDirName = "<%= CLIENT_DIST_DIR %>"
    <%_ } _%>
    enabled = true
    extension = "war.original"
    includes = ["WEB-INF/**", "META-INF/**"]
}

springBoot {
    mainClassName = "<%= packageName %>.<%= mainClass %>"
}

test {
    useJUnitPlatform()
    exclude "**/*IT*", "**/*IntTest*", "**/*CucumberIT*"

    testLogging {
        events 'FAILED', 'SKIPPED'
    }
    // uncomment if the tests reports are not generated
    // see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
    // ignoreFailures true
    reports.html.enabled = false
}

task integrationTest(type: Test) {
    useJUnitPlatform()
    description = "Execute integration tests."
    group = "verification"
    include "**/*IT*", "**/*IntTest*"
    exclude "**/*CucumberIT*"

    testLogging {
        events 'FAILED', 'SKIPPED'
    }
    // uncomment if the tests reports are not generated
    // see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
    // ignoreFailures true
    reports.html.enabled = false
}
<%_ if (cucumberTests) { _%>

task cucumberTest(type: Test) {
    description = "Execute cucumber BDD tests."
    group = "verification"
    include "**/*CucumberIT*"

    // uncomment if the tests reports are not generated
    // see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
    // ignoreFailures true
    reports.html.enabled = false
}

check.dependsOn cucumberTest
<%_ } _%>

check.dependsOn integrationTest
task testReport(type: TestReport) {
    destinationDir = file("$buildDir/reports/tests")
    reportOn test
}

task integrationTestReport(type: TestReport) {
    destinationDir = file("$buildDir/reports/tests")
    reportOn integrationTest
}

<%_ if (cucumberTests) { _%>
task cucumberTestReport(type: TestReport) {
    destinationDir = file("$buildDir/reports/tests")
    reportOn cucumberTest
}

<%_ } _%>
<%_ if (databaseType === 'sql') { _%>
if (!project.hasProperty("runList")) {
    project.ext.runList = "main"
}

project.ext.diffChangelogFile = "<%= SERVER_MAIN_RES_DIR %>config/liquibase/changelog/" + new Date().format("yyyyMMddHHmmss") + "_changelog.xml"

liquibase {
    activities {
        main {
            driver "<% if (devDatabaseType === 'mysql') { %>com.mysql.jdbc.Driver<% } else if (devDatabaseType === 'mariadb') { %>org.mariadb.jdbc.Driver<% } else if (devDatabaseType === 'postgresql') { %>org.postgresql.Driver<% } else if (devDatabaseType === 'h2Disk') { %>org.h2.Driver<% } else if (devDatabaseType === 'oracle') { %>oracle.jdbc.OracleDriver<% } %>"
            url "<% if (devDatabaseType === 'mysql') { %>jdbc:mysql://localhost:3306/<%= baseName %><% } else if (devDatabaseType === 'mariadb') { %>jdbc:mariadb://localhost:3306/<%= baseName %><% } else if (devDatabaseType === 'postgresql') { %>jdbc:postgresql://localhost:5432/<%= baseName %><% } else if (devDatabaseType === 'h2Disk') { %>jdbc:h2:file:./target/h2db/db/<%= lowercaseBaseName %><% } else if (devDatabaseType === 'oracle') { %>jdbc:oracle:thin:@localhost:1521:<%= baseName %><% } else if (devDatabaseType === 'mssql') { %>jdbc:sqlserver://localhost:1433;database=<%= baseName %><% } %>"
            username "<% if (devDatabaseType === 'mysql') { %>root<% } else if (devDatabaseType === 'postgresql' || devDatabaseType === 'h2Disk' || devDatabaseType === 'h2Memory') { %><%= baseName %><% } else if (devDatabaseType === 'mssql') { %>SA<% } %>"
            password "<% if (devDatabaseType === 'mssql') { %>yourStrong(!)Password<% } %>"
            changeLogFile "<%= SERVER_MAIN_RES_DIR %>config/liquibase/master.xml"
            defaultSchemaName "<% if (devDatabaseType === 'mysql') { %><%= baseName %><% } else if (devDatabaseType === 'postgresql') { %><% } %>"
            logLevel "debug"
            classpath "<%= SERVER_MAIN_RES_DIR %>"
        }
        diffLog {
            driver "<% if (devDatabaseType === 'mysql') { %>com.mysql.jdbc.Driver<% } else if (devDatabaseType === 'mariadb') { %>org.mariadb.jdbc.Driver<% } else if (devDatabaseType === 'postgresql') { %>org.postgresql.Driver<% } else if (devDatabaseType === 'h2Disk') { %>org.h2.Driver<% } else if (devDatabaseType === 'oracle') { %>oracle.jdbc.OracleDriver<% } %>"
            url "<% if (devDatabaseType === 'mysql') { %>jdbc:mysql://localhost:3306/<%= baseName %><% } else if (devDatabaseType === 'mariadb') { %>jdbc:mariadb://localhost:3306/<%= baseName %><% } else if (devDatabaseType === 'postgresql') { %>jdbc:postgresql://localhost:5432/<%= baseName %><% } else if (devDatabaseType === 'h2Disk') { %>jdbc:h2:file:./target/h2db/db/<%= lowercaseBaseName %><% } else if (devDatabaseType === 'oracle') { %>jdbc:oracle:thin:@localhost:1521:<%= baseName %><% } else if (devDatabaseType === 'mssql') { %>jdbc:sqlserver://localhost:1433;database=<%= baseName %><% } %>"
            username "<% if (devDatabaseType === 'mysql') { %>root<% } else if (devDatabaseType === 'postgresql' || devDatabaseType === 'h2Disk' || devDatabaseType === 'h2Memory') { %><%= baseName %><% } else if (devDatabaseType === 'mssql') { %>SA<% } %>"
            password "<% if (devDatabaseType === 'mssql') { %>yourStrong(!)Password<% } %>"
            changeLogFile project.ext.diffChangelogFile
            referenceUrl "hibernate:spring:<%=packageName%>.domain?dialect=<% if (devDatabaseType === 'mysql') { %>org.hibernate.dialect.MySQL5InnoDBDialect<% } else if (devDatabaseType === 'mariadb') { %>org.hibernate.dialect.MySQL5InnoDBDialect<% } else if (devDatabaseType === 'postgresql') { %>org.hibernate.dialect.PostgreSQL95Dialect<% } else if (devDatabaseType === 'h2Disk') { %>org.hibernate.dialect.H2Dialect<% } else if (devDatabaseType === 'oracle') { %>org.hibernate.dialect.Oracle12cDialect<% } else if (devDatabaseType === 'mssql') { %>org.hibernate.dialect.SQLServerDialect<% } %>&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy"
            defaultSchemaName "<% if (devDatabaseType === 'mysql') { %><%= baseName %><% } else if (devDatabaseType === 'postgresql') { %><% } %>"
            logLevel "debug"
            classpath "$buildDir/classes/java/main"
            <%_ if (authenticationType === 'oauth2') { _%>
            excludeObjects "oauth_access_token, oauth_approvals, oauth_client_details, oauth_client_token, oauth_code, oauth_refresh_token"
            <%_ } _%>
        }
    }

    runList = project.ext.runList
}

<%_ } _%>
configurations {
    providedRuntime
    implementation.exclude module: "spring-boot-starter-tomcat"
}

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
    <%_ if (devDatabaseType === 'oracle' || prodDatabaseType === 'oracle') { _%>
    // more information at https://blogs.oracle.com/dev2dev/entry/how_to_get_oracle_jdbc
    // https://discuss.gradle.org/t/support-for-maven-repositories-that-use-realm-based-sso/14456/5
    maven {
        url "https://www.oracle.com/content/secure/maven/content"
        credentials {
            username ''
            password ''
        }
    }
    <%_ } _%>
    //jhipster-needle-gradle-repositories - JHipster will add additional repositories
}

dependencies {
    // import JHipster dependencies BOM
    implementation platform("io.github.jhipster:jhipster-dependencies:${jhipster_dependencies_version}" )

    // Use ", version: jhipster_dependencies_version, changing: true" if you want
    // to use a SNAPSHOT release instead of a stable release
    implementation group: "io.github.jhipster", name: "jhipster-framework"<% if (reactive) { %>, {
        exclude group: "org.springframework", module: "spring-webmvc"
    }<% } %>
    <%_ if (cacheProvider !== 'no') { _%>
    implementation "org.springframework.boot:spring-boot-starter-cache"
    <%_ } _%>
    implementation "io.dropwizard.metrics:metrics-core"
    implementation "io.micrometer:micrometer-registry-prometheus"
    implementation "net.logstash.logback:logstash-logback-encoder"
    implementation "com.fasterxml.jackson.datatype:jackson-datatype-hppc"
    implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
    <%_ if (databaseType === 'sql') { _%>
    implementation "com.fasterxml.jackson.datatype:jackson-datatype-hibernate5"
    <%_ } _%>
    implementation "com.fasterxml.jackson.core:jackson-annotations"
    implementation "com.fasterxml.jackson.core:jackson-databind"
    implementation "com.fasterxml.jackson.module:jackson-module-afterburner"
    <%_ if (applicationType === 'gateway' && authenticationType === 'uaa') { _%>
    implementation "org.apache.httpcomponents:httpclient"
    <%_ } _%>
    <%_ if (cacheProvider === 'hazelcast') { _%>
    implementation "com.hazelcast:hazelcast"
    <%_ if (enableHibernateCache) { _%>
    implementation "com.hazelcast:hazelcast-hibernate53"
    <%_ } _%>
    implementation "com.hazelcast:hazelcast-spring"
    <%_ } _%>
    <%_ if ((applicationType === 'gateway') && cacheProvider !== 'hazelcast') { _%>
    implementation "com.hazelcast:hazelcast"
    implementation "com.hazelcast:hazelcast-spring"
    <%_ } _%>
    <%_ if (cacheProvider === 'infinispan') { _%>
    implementation "org.infinispan:infinispan-hibernate-cache-v53"
    implementation "org.infinispan:infinispan-spring-boot-starter-embedded"
    implementation "org.infinispan:infinispan-core"
    implementation "org.infinispan:infinispan-jcache"
    implementation ("org.infinispan:infinispan-cloud") {
        exclude module: "undertow-core"
    }
    <%_ } _%>
    <%_ if (cacheProvider === 'memcached') { _%>
    implementation "com.google.code.simple-spring-memcached:spring-cache"
    implementation "com.google.code.simple-spring-memcached:xmemcached-provider"
    implementation "com.googlecode.xmemcached:xmemcached"
    <%_ } _%>
    <%_ if (['ehcache', 'hazelcast', 'infinispan'].includes(cacheProvider) || applicationType === 'gateway') { _%>
    implementation "javax.cache:cache-api"
    <%_ } _%>
    <%_ if (databaseType === 'sql') { _%>
    implementation "org.hibernate:hibernate-core"
    implementation "com.zaxxer:HikariCP"
    <%_ } _%>
    <%_ if (databaseType === 'cassandra' || applicationType === 'gateway') { _%>
    implementation "commons-codec:commons-codec"
    <%_ } _%>
    implementation "org.apache.commons:commons-lang3"
    implementation "commons-io:commons-io"
    implementation "javax.transaction:javax.transaction-api"
    <%_ if (databaseType === 'cassandra') { _%>
    implementation "org.lz4:lz4-java"
    <%_ } _%>
    <%_ if (cacheProvider === 'ehcache') { _%>
    implementation "org.ehcache:ehcache"
        <%_ if (enableHibernateCache) { _%>
    implementation "org.hibernate:hibernate-jcache"
        <%_ } _%>
    <%_ } _%>
    <%_ if (databaseType === 'sql') { _%>
    implementation "org.hibernate:hibernate-entitymanager"
    implementation "org.hibernate:hibernate-envers"
    implementation "org.hibernate.validator:hibernate-validator"
    implementation "org.liquibase:liquibase-core"
    liquibaseRuntime "org.liquibase:liquibase-core"
    liquibaseRuntime "org.liquibase.ext:liquibase-hibernate5:${liquibase_hibernate5_version}"
    liquibaseRuntime sourceSets.main.compileClasspath
    <%_ } _%>
    implementation "org.springframework.boot:spring-boot-loader-tools"
    implementation "org.springframework.boot:spring-boot-starter-mail"
    implementation "org.springframework.boot:spring-boot-starter-logging"
    implementation "org.springframework.boot:spring-boot-starter-actuator"
    implementation "org.springframework.boot:spring-boot-starter-aop"
    <%_ if (databaseType === 'sql') { _%>
    implementation "org.springframework.boot:spring-boot-starter-data-jpa"
    <%_ } _%>
    <%_ if (searchEngine === 'elasticsearch') { _%>
    implementation "org.springframework.boot:spring-boot-starter-data-elasticsearch"
    // Spring Data Jest dependencies for Elasticsearch
    implementation ("com.github.vanroy:spring-boot-starter-data-jest") {
        exclude module: "commons-logging"
    }
    // log4j2-mock needed to create embedded elasticsearch instance with SLF4J
    runtimeOnly "de.dentrassi.elasticsearch:log4j2-mock:0.0.1"
    // end of Spring Data Jest dependencies
    <%_ } _%>
    <%_ if (['mongodb', 'cassandra', 'couchbase'].includes(databaseType)) { _%>
    implementation "org.springframework.boot:spring-boot-starter-data-<%=databaseType%><% if (reactive) { %>-reactive<% } %>"
    <%_ } _%>
    <%_ if (messageBroker === 'kafka') { _%>
    implementation "org.springframework.cloud:spring-cloud-stream"
    implementation "org.springframework.cloud:spring-cloud-stream-binder-kafka"
    implementation "org.springframework.kafka:spring-kafka"
    <%_ } _%>
    implementation "org.springframework.boot:spring-boot-starter-security"
    implementation ("org.springframework.boot:spring-boot-starter-web<% if (reactive) { %>flux<% } %>") {
        exclude module: "spring-boot-starter-tomcat"
    }
    <%_ if (!reactive) { _%>
    implementation "org.springframework.boot:spring-boot-starter-undertow"
    <%_ } _%>
    <%_ if (reactive) { _%>
    implementation "org.springframework.boot:spring-boot-starter-validation"
    implementation "io.netty:netty-tcnative-boringssl-static"
    <%_ } _%>
    <%_ if (websocket === 'spring-websocket') { _%>
    implementation "org.springframework.boot:spring-boot-starter-websocket"
    <%_ } _%>
    implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
    implementation "org.zalando:problem-spring-web<% if (reactive) { %>flux<% } %>"
    <%_ if (databaseType === 'cassandra') { _%>
    implementation "com.datastax.cassandra:cassandra-driver-extras"
    implementation "com.datastax.cassandra:cassandra-driver-mapping"
    <%_ } _%>
    <%_ if (applicationType === 'gateway') { _%>
    implementation "org.springframework.cloud:spring-cloud-starter-netflix-zuul"
    implementation "com.github.vladimir-bukhtoyarov:bucket4j-core"
    implementation "com.github.vladimir-bukhtoyarov:bucket4j-jcache"
    <%_ } _%>
    <%_ if (applicationType === 'microservice' || applicationType === 'gateway' || applicationType === 'uaa') { _%>
    implementation "org.springframework.cloud:spring-cloud-starter"
    implementation "org.springframework.cloud:spring-cloud-starter-netflix-ribbon"
    implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix"
    implementation "org.springframework.retry:spring-retry"
    <%_ } _%>
    <%_ if (serviceDiscoveryType === 'eureka') { _%>
    implementation "org.springframework.cloud:spring-cloud-starter-netflix-eureka-client"
    implementation "org.springframework.cloud:spring-cloud-starter-config"
    <%_ } _%>
    <%_ if (serviceDiscoveryType === 'consul') { _%>
    implementation "org.springframework.cloud:spring-cloud-starter-consul-discovery"
    implementation "org.springframework.cloud:spring-cloud-starter-consul-config"
    <%_ } _%>
    <%_ if (authenticationType === 'uaa') { _%>
    implementation "org.springframework.cloud:spring-cloud-security"
    <%_ } _%>
    <%_ if (applicationType === 'microservice' || applicationType === 'gateway' || applicationType === 'uaa') { _%>
    implementation "org.springframework.cloud:spring-cloud-starter-openfeign"
    <%_ } _%>
    implementation "org.springframework.boot:spring-boot-starter-cloud-connectors"
    implementation "org.springframework.security:spring-security-config"
    implementation "org.springframework.security:spring-security-data"
    implementation "org.springframework.security:spring-security-web"
    <%_ if (websocket === 'spring-websocket') { _%>
    implementation "org.springframework.security:spring-security-messaging"
    <%_ } _%>
    <%_ if (authenticationType === 'oauth2') { _%>
    implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
    implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
    <%_ } _%>
    <%_ if (authenticationType === 'jwt') { _%>
    implementation "io.jsonwebtoken:jjwt-api"
    runtimeOnly "io.jsonwebtoken:jjwt-impl"
    runtimeOnly "io.jsonwebtoken:jjwt-jackson"
    <%_ } _%>
    <%_ if (authenticationType === 'uaa') { _%>
    implementation "org.springframework.security.oauth:spring-security-oauth2"
    implementation "org.springframework.security:spring-security-jwt"
    <% if (databaseType === 'sql') { %>implementation<% } else { %>runtimeOnly<% } %> "org.glassfish.jaxb:jaxb-runtime:${jaxb_runtime_version}"
    <%_ } _%>
    <%_ if (databaseType === 'mongodb') { _%>
    implementation "com.github.mongobee:mongobee"
    <%_ } _%>
    <%_ if (databaseType === 'couchbase') { _%>
    implementation "com.github.differentway:couchmove"
    implementation "com.couchbase.client:java-client"
    implementation "com.couchbase.client:encryption"
    <%_ } _%>
    <%_ if (!reactive) { _%>
    implementation ("io.springfox:springfox-swagger2") {
        exclude module: "mapstruct"
    }
    implementation "io.springfox:springfox-bean-validators"
    <%_ } _%>
    <%_ if (devDatabaseType === 'mysql' || prodDatabaseType === 'mysql') { _%>
    implementation "mysql:mysql-connector-java"
    liquibaseRuntime "mysql:mysql-connector-java"
    <%_ } _%>
    <%_ if (devDatabaseType === 'postgresql' || prodDatabaseType === 'postgresql') { _%>
    implementation "org.postgresql:postgresql"
    liquibaseRuntime "org.postgresql:postgresql"
    <%_ } _%>
    <%_ if (devDatabaseType === 'mariadb' || prodDatabaseType === 'mariadb') { _%>
    implementation "org.mariadb.jdbc:mariadb-java-client"
    liquibaseRuntime "org.mariadb.jdbc:mariadb-java-client"
    <%_ } _%>
    <%_ if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { _%>
    implementation "com.microsoft.sqlserver:mssql-jdbc"
    implementation "com.github.sabomichal:liquibase-mssql"
    liquibaseRuntime  "com.microsoft.sqlserver:mssql-jdbc"
    liquibaseRuntime "com.github.sabomichal:liquibase-mssql"
    <%_ } _%>
    implementation "org.mapstruct:mapstruct:${mapstruct_version}"
    annotationProcessor "org.mapstruct:mapstruct-processor:${mapstruct_version}"
    <%_ if (databaseType === 'sql') { _%>
    annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernate_version}"
        <%_ if (authenticationType !== 'uaa') { _%>
    annotationProcessor "org.glassfish.jaxb:jaxb-runtime:${jaxb_runtime_version}"
        <%_ } _%>
    <%_ } _%>
    annotationProcessor ("org.springframework.boot:spring-boot-configuration-processor:${spring_boot_version}") {
        exclude group: "com.vaadin.external.google", module: "android-json"
    }
    testImplementation "com.jayway.jsonpath:json-path"
    <%_ if (databaseType === 'cassandra') { _%>
    testImplementation ("org.cassandraunit:cassandra-unit-spring") {
        exclude(group: "org.slf4j")
    }
    testImplementation "org.testcontainers:database-commons"
    <%_ } _%>
    <%_ if (cucumberTests) { _%>
    testImplementation "io.cucumber:cucumber-junit"
    testImplementation "io.cucumber:cucumber-spring"
    <%_ } _%>
    testImplementation ("org.springframework.boot:spring-boot-starter-test") {
        exclude module: "junit"
        exclude group: "com.vaadin.external.google", module: "android-json"
    }
    testImplementation "org.springframework.security:spring-security-test"
    testImplementation "org.springframework.boot:spring-boot-test"
    testImplementation "org.junit.jupiter:junit-jupiter-engine"
    <%_ if (cucumberTests) { _%>
    testImplementation "org.junit.vintage:junit-vintage-engine"
    <%_ } _%>
    testImplementation "org.assertj:assertj-core"
    testImplementation "junit:junit"
    testImplementation "org.mockito:mockito-core"
    <%_ if (databaseType === 'mongodb') { _%>
    testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo"
    <%_ } _%>
    <%_ if (databaseType === 'couchbase') { _%>
    testImplementation "com.github.differentway:couchbase-testcontainer"
    <%_ } _%>
    testImplementation "org.hamcrest:hamcrest-library"
    <%_ if (databaseType === 'sql') { _%>
    testImplementation "com.h2database:h2"
    <%_ } _%>
    <%_ if (devDatabaseType === 'h2Disk' || devDatabaseType === 'h2Memory') { _%>
    liquibaseRuntime "com.h2database:h2"
    <%_ } _%>
    <%_ if (devDatabaseType === 'oracle' || prodDatabaseType === 'oracle') { _%>
    implementation "com.oracle.jdbc:ojdbc8"
    liquibaseRuntime "com.oracle.jdbc:ojdbc8"
    <%_ } _%>
    <%_ if (messageBroker === 'kafka') { _%>
    testImplementation "org.springframework.cloud:spring-cloud-stream-test-support"
    <%_ } _%>
    //jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
}

task cleanResources(type: Delete) {
    delete "build/resources"
}

wrapper {
    gradleVersion = "5.4.1"
}
<%_ if (!skipClient) { _%>

if (project.hasProperty("nodeInstall")) {
    node {
        version = "${node_version}"
        npmVersion = "${npm_version}"
        yarnVersion = "${yarn_version}"
        download = true
    }
}

<%_ } _%>
compileJava.dependsOn processResources
processResources.dependsOn bootBuildInfo
