plugins {
    id "java"
    id "jacoco"
    id "io.spring.dependency-management" version "1.0.6.RELEASE"
    id "org.springframework.boot" version "2.0.2.RELEASE"
    id "org.sonarqube" version "2.6.1"
}

group "com.epam.pipeline"


sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

bootJar {
    archiveName "elasticsearch-agent.jar"
    manifest {
        attributes(
                "Implementation-Version": "$version")
    }
}

repositories {
    mavenCentral()
}

dependencies {

    // Core library
    implementation project(":cloud-pipeline-common:model")

    configurations {
        all*.exclude module : 'spring-boot-starter-logging'
    }
    compile("org.aspectj:aspectjweaver:1.8.8")

    //SpringBoot
    implementation group: "org.springframework.boot", name: "spring-boot-starter", version: springBootVersion
    implementation group: "org.springframework.boot", name: "spring-boot-starter-jdbc", version: springBootVersion
    implementation group: "org.springframework.boot", name: "spring-boot-starter-web", version: springBootVersion

    // Elasticsearch
    implementation group: "org.elasticsearch.client", name: "elasticsearch-rest-client", version: elasticsearchVersion
    implementation group: "org.elasticsearch.client", name: "elasticsearch-rest-high-level-client", version: elasticsearchVersion
    implementation group: "org.elasticsearch", name: "elasticsearch", version: elasticsearchVersion

    // DB
    // Pool
    implementation group: "com.mchange", name: "c3p0", version: c3p0Version
    //Postgres
    implementation group: "org.postgresql", name: "postgresql", version: postgresqlVersion

    // Logging
    implementation group: "org.apache.logging.log4j", name: "log4j-slf4j-impl", version: log4jVersion
    implementation group: "org.apache.logging.log4j", name: "log4j-api", version: log4jVersion
    implementation group: "org.apache.logging.log4j", name: "log4j-core", version: log4jVersion
    implementation group: "org.apache.logging.log4j", name: "log4j-jcl", version: log4jVersion

    // Apache Commons
    implementation group: "commons-io", name: "commons-io", version: apacheCommonsIOVersion
    implementation group: "org.apache.commons", name: "commons-lang3", version: apacheCommonsLangVersion
    implementation group: "org.apache.commons", name: "commons-collections4", version: apacheCommonsCollectionsVersion

    //Lombok
    implementation group: "org.projectlombok", name: "lombok", version: lombokVersion

    // Retrofit
    implementation group: "com.squareup.retrofit2", name: "retrofit", version: retrofitVersion
    implementation group: "com.squareup.retrofit2", name: "converter-jackson", version: retrofitVersion
    implementation group: "com.squareup.okhttp3", name: "okhttp", version: okhttpVersion

    // Jackson
    implementation group: "com.fasterxml.jackson.core", name: "jackson-databind", version: jaksonVersion

    // Swagger
    implementation group: "io.springfox", name: "springfox-swagger2", version: swaggerVersion
    implementation group: "io.springfox", name: "springfox-swagger-ui", version: swaggerVersion

    // AWS
    implementation group: "com.amazonaws", name: "aws-java-sdk-s3", version: awsSdkS3Version
    implementation group: "com.amazonaws", name: "aws-java-sdk-sts", version: awsSdkSTSVersion
    
    // Azure
    compile group: "com.microsoft.azure", name: "azure-storage-blob", version: azureSdkBlobVersion

    //GS Bucket
    compile group:"com.google.cloud", name:"google-cloud-storage", version:googleStorageSdkVersion

    //Tests
    implementation group: "org.springframework.boot", name: "spring-boot-starter-test", version: springBootVersion
    testImplementation group: "org.projectlombok", name: "lombok", version: lombokVersion
    testImplementation group: "org.elasticsearch.client", name: "transport", version: elasticsearchVersion
    testImplementation group: "org.junit.jupiter", name: "junit-jupiter-api", version: junitVersion
    testImplementation group: "org.junit.jupiter", name: "junit-jupiter-engine", version: junitVersion
    testImplementation group: "org.hamcrest", name: "hamcrest-all", version: hamcrestVersion

    testImplementation group: "org.mockito", name: "mockito-core", version: mockitoVersion
    testImplementation group: "org.mockito", name: "mockito-junit-jupiter", version: mockitoVersion

    //ShedLock
    compile group: 'net.javacrumbs.shedlock', name: 'shedlock-spring', version: shedlockVersion
    compile group: 'net.javacrumbs.shedlock', name: 'shedlock-provider-jdbc-template', version: shedlockVersion
}

test {
    useJUnitPlatform()

    reports {
        html.enabled = true
    }
}
