apply plugin: 'war'
apply plugin: 'tomcat'

apply from: "$rootDir/gradle/functionalTest.gradle"

jvmsrc {
  packageName "com.ak.spring3.music"
}

buildscript {
  dependencies {
    classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:1.2.3'
  }
}

dependencies {
  compile libs.springWeb.call() //Call the closure - its not a list like the others
  compile libs.jackson
  compile libs.logging
  compile libs.jackson
  compile libs.swagger
  compile libs.validation

  compile 'javax.servlet:jstl:1.2'
  providedCompile 'javax.servlet:javax.servlet-api:3.0.1'

  compile project(':shared-api')
  compile libs.swaggerSpringMvcUi

  tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}"
  tomcat "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'
  }
  tomcat "org.apache.tomcat:tomcat-dbcp:${tomcatVersion}"

}

functionalTest.dependsOn tomcatRun
functionalTest.finalizedBy tomcatStop

tomcat {
  httpPort = 9080
  ajpPort = 9009
  stopPort = 9091
  stopKey = 'stopKey'
}

tomcatRun.daemon = project.hasProperty('tcDaemon') ? true : false
