buildscript {
    ext {
        springBootVersion = '1.4.0.RELEASE'
    }
    repositories {
        mavenCentral()
        maven { url "https://repo.spring.io/milestone" }
    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
    }
}

group 'dynamind'
version '0.1-SNAPSHOT'

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'idea'
apply plugin: 'spring-boot'

jar {
    baseName = rootProject.name
    version = '0.0.1-SNAPSHOT'
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

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

dependencies {
    // By excluding Tomcat from starter-web and adding it as a provided dependency, 
    // we can deploy as a WAR on a servlet container or run as a standalone application
    compile(group: 'org.springframework.boot', name: 'spring-boot-starter-web') {
        exclude(module: 'spring-boot-starter-tomcat')
        exclude(group: 'org.apache.tomcat.embed')
    }
    providedCompile(group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat')

    compile(group: 'org.springframework.boot', name: 'spring-boot-starter-security')
    compile(group: 'org.springframework.security', name: 'spring-security-jwt', version: '1.0.3.RELEASE')
    compile(group: 'org.springframework.security.oauth', name: 'spring-security-oauth2', version: '2.0.8.RELEASE') {
        exclude(module: 'jackson-mapper-asl') // We already have a more recent jackson via Spring Boot
    }

}

// Create the wrapper support files by running 'gradle wrapper',
task wrapper(type: Wrapper) {
    gradleVersion = '2.9'
}
