/*
 * Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/)
 *
 * 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 { mavenCentral() }
}

plugins {
    id "io.spring.dependency-management" version "1.0.0.RELEASE"
    id "org.sonarqube" version "2.6.1"
}

group 'com.epam.pipeline'

ext { springBootVersion = '1.5.2.RELEASE' }

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'

sourceCompatibility = 1.8

repositories { mavenCentral() }

dependencies {
    compile('org.springframework.boot:spring-boot-starter')
    testCompile('org.springframework.boot:spring-boot-starter-test')

    compile('org.springframework.boot:spring-boot-starter-data-jpa')

    compile group: 'org.springframework.security', name: 'spring-security-acl', version: '4.2.2.RELEASE'

    compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.8.7'
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.7'
    compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.9.6'

    compile group: 'commons-io', name: "commons-io", version: "2.4"
    compile group: 'commons-validator', name: "commons-validator", version: "1.5.0"
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7'
    compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
    compile group: 'org.apache.commons', name: "commons-collections4", version: "4.0"
    compile group: "org.apache.commons", name: "commons-text", version: "1.4"

    compileOnly "org.projectlombok:lombok:1.16.16"

    compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.6.1'

    compile 'io.fabric8:kubernetes-model:1.0.67'

    // Retrofit
    compile group: 'com.squareup.retrofit2', name: 'retrofit', version: '2.3.0'
    compile group: 'com.squareup.retrofit2', name: 'converter-jackson', version: '2.3.0'
    compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.9.1'
    compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.9.6'
    compile group: 'com.squareup.retrofit2', name: 'converter-scalars', version: '2.3.0'

    // Mockito
    testImplementation group: "org.mockito", name: "mockito-core", version: '2.21.0'

    // Map struct
    compile 'org.mapstruct:mapstruct-jdk8:1.2.0.Final'
    compile 'org.mapstruct:mapstruct-processor:1.2.0.Final'
}

dependencyManagement {
    imports {
        mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
    }
}

task sourcesJar(type: Jar) {
    from sourceSets.main.allJava
    classifier = 'sources'
}

model {
    publishing {
        publications {
            mavenJava(MavenPublication) {
                from components.java
                artifact sourcesJar
            }
        }
    }
}
