buildscript {
    repositories {
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath "gradle.plugin.com.avast.gradle:gradle-docker-compose-plugin:1"
        classpath "org.owasp:dependency-check-gradle:5.2.1"
        classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:2.0.0"
    }
}

allprojects {
    apply plugin: 'idea'
}

subprojects {
    repositories {
        maven { url "https://maven.aliyun.com/repository/central" }
        maven { url "https://mymavenrepo.com/repo/2w5k9sU2AsKfaYehyqno/" }
    }

    apply plugin: 'java'

    sourceCompatibility = 1.8
    targetCompatibility = 1.8

    dependencies {
        compileOnly 'org.projectlombok:lombok:1.18.8'
        annotationProcessor 'org.projectlombok:lombok:1.18.8'


        //test dependencies
        testImplementation platform('org.junit:junit-bom:5.5.1')
        testImplementation("org.junit.jupiter:junit-jupiter-api")
        testImplementation('org.junit.jupiter:junit-jupiter-engine')
        testImplementation('org.mockito:mockito-junit-jupiter:2.26.0')
    }


    configurations.all {
        exclude group: "junit", module: "junit"
        exclude group: "org.assertj", module: "assertj-core"
        // Check for updates every build
        resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    }

    tasks.withType(Test) {
        useJUnitPlatform()
    }

    wrapper {
        gradleVersion = '5.6'
    }

    apply from: "${rootProject.projectDir}/gradle/dependency-check/dependency-check.gradle"
    apply from: "${rootProject.projectDir}/gradle/spotbugs/spotbugs.gradle"
    apply from: "${rootProject.projectDir}/gradle/checkstyle/checkstyle.gradle"
    apply from: "${rootProject.projectDir}/gradle/git-hooks/git-hooks.gradle"

}

