buildscript {
    ext {
        springBootVersion = "1.5.22.RELEASE"
        slf4jVersion = "1.7.30"
        logbackVersion = "1.2.3"
    }
    repositories {
        mavenCentral()
        maven { url 'https://repo.spring.io/plugins-release' }
        maven { url "https://plugins.gradle.org/m2/" }
    }

    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        classpath 'io.spring.gradle:propdeps-plugin:0.0.10.RELEASE'
        classpath 'io.spring.gradle:dependency-management-plugin:1.0.6.RELEASE'
        classpath 'org.springframework:springloaded:1.2.8.RELEASE'
    }
}


apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'application'

idea {
    module {
        inheritOutputDirs = false
        outputDir = file("$buildDir/classes/main/")

        testOutputDir = file('build-test')
    }
}


bootRun {
    addResources = true
}

bootRepackage {
    enabled = false
    withJarTask = jar
    executable = false
}

springBoot {
    mainClass = "com.avast.server.hdfsshell.MainApp"
}


repositories {
    mavenCentral()
    maven { url 'https://artifactory.int.avast.com/artifactory/maven' }
    maven { url 'https://repo.spring.io/libs-release' }
    maven { url 'https://repo.spring.io/plugins-release' }
}

jar {

    manifest {
        attributes("Implementation-Version": project.getVersion())
    }
}

mainClassName = "com.avast.server.hdfsshell.MainApp"


allprojects {
    tasks.withType(Javadoc).all { enabled = false }
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

group = theGroup
version = theVersion

dependencies {
    compile "org.slf4j:slf4j-api:${slf4jVersion}"
    compile "org.slf4j:log4j-over-slf4j:${slf4jVersion}"
    compile "org.slf4j:jcl-over-slf4j:${slf4jVersion}"
    compile "ch.qos.logback:logback-classic:${logbackVersion}"

    compile 'javax.annotation:javax.annotation-api:1.3.2'

    compile("org.springframework.boot:spring-boot-starter:${springBootVersion}"){
        exclude group: 'log4j'
        exclude group: 'common-logging'
    }
    compile "org.springframework.shell:spring-shell:1.2.0.RELEASE"

    compile 'com.kohlschutter.junixsocket:junixsocket-native-common:2.0.4'
    compile 'com.kohlschutter.junixsocket:junixsocket-common:2.0.4'

    compile "org.apache.commons:commons-lang3:3.3.2"
    compile "org.apache.hadoop:hadoop-client:2.6.0"

    testCompile 'junit:junit:4.12'
    testCompile("org.springframework.boot:spring-boot-starter-test:${springBootVersion}")

    configurations {
        all*.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
        all*.exclude group: 'log4j', module: 'log4j'
        all*.exclude group: 'commons-logging'
    }
}

