buildscript {
    ext {
        springBootVersion = '2.1.0.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

allprojects {
    apply plugin: 'java'
    apply plugin: 'idea'
    apply plugin: 'org.springframework.boot'
    apply plugin: 'io.spring.dependency-management'
    apply plugin: 'checkstyle'

    sourceCompatibility = 1.8
    ext['springCloudVersion'] = 'Greenwich.M3'
    group 'com.epam.dsc2019'

    bootJar {
        enabled = false
    }

    checkstyle {
        toolVersion = "8.26"
        maxErrors = 0
        maxWarnings = 0
    }

    repositories {
        mavenCentral()
        maven {
            url "https://repo.spring.io/milestone"
        }
    }

    configurations {
        compileOnly {
            extendsFrom annotationProcessor
        }
    }

    dependencies {
        compileOnly('org.projectlombok:lombok')
        annotationProcessor('org.projectlombok:lombok')

        implementation('org.springframework.boot:spring-boot-starter-web')

        runtimeOnly('org.springframework.boot:spring-boot-devtools')
        compileOnly('org.springframework.boot:spring-boot-configuration-processor')

        testImplementation('org.springframework.boot:spring-boot-starter-test')
        testCompile('org.hamcrest:hamcrest-all:1.3')
    }

    dependencyManagement {
        imports {
            mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
        }
    }
}
