buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.bmuschko:gradle-tomcat-plugin:2.0'
    }
}

plugins {
    id 'java'
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'com.bmuschko.tomcat'

group 'com.epam'
version '1.0-SNAPSHOT'


sourceCompatibility = 1.8

repositories {
    mavenLocal()
    mavenCentral()
}
war {
    enabled=true
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
    // https://mvnrepository.com/artifact/log4j/log4j
    compile group: 'log4j', name: 'log4j', version: '1.2.16'
    // https://mvnrepository.com/artifact/commons-codec/commons-codec
    compile group: 'commons-codec', name: 'commons-codec', version: '1.14'


    // https://mvnrepository.com/artifact/javax/javaee-api
    compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'

    // https://mvnrepository.com/artifact/com.h2database/h2
    compile group: 'com.h2database', name: 'h2', version: '1.4.197'

    // https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api
    providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'

    // https://mvnrepository.com/artifact/javax.servlet/jstl
    compile group: 'javax.servlet', name: 'jstl', version: '1.2'


    def tomcatVersion = '7.0.57'
    tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
            "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}"
    tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
        exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj'
    }
}

// context where tomcat is deployed, by defautl localhost:8080/
tomcatRun.contextPath = '/userlib'
tomcatRunWar.contextPath = '/userlib'
tomcatRunWar.httpPort = 8080
tomcatRun.httpPort = 8080


