buildscript {
	ext {
		springBootVersion = '1.3.2.RELEASE'
	}
	repositories {
		mavenCentral()
	}
	dependencies {
		classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
		
		//Docker Plugin
		classpath('se.transmode.gradle:gradle-docker:1.2')
	}
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot' 

//Dokcer Plugin


/* Uncomment to create an Executable file (app as a Service)
springBoot {
	executable = true
}
*/

//Docker Stuff
/*
group = 'springboot'
apply plugin: 'docker'

task buildDocker(type: Docker, dependsOn: build) {
  push = true
  applicationName = jar.baseName
  dockerfile = file('src/main/resources/docker/Dockerfile')
  doFirst {
	copy {
	  from jar
	  into stageDir
	}
  }
}
*/


jar {
	baseName = 'spring-boot-journal'
	version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
	mavenCentral()
}

//Executable WAR
/*
apply plugin: 'war'

war {
	baseName = 'spring-boot-journal'
	version =  '0.0.1-SNAPSHOT'
}
configurations {
	providedRuntime
}
*/


dependencies {
	compile('org.springframework.boot:spring-boot-starter-actuator')
	compile('org.springframework.boot:spring-boot-actuator-docs')
	compile('org.springframework.boot:spring-boot-starter-data-jpa')
	compile('org.springframework.boot:spring-boot-starter-data-rest')
	compile('org.springframework.boot:spring-boot-starter-security')
	compile('org.springframework.boot:spring-boot-starter-thymeleaf')
	compile('org.springframework.boot:spring-boot-starter-web')
	compile('org.springframework.security:spring-security-taglibs')
	compile('org.thymeleaf.extras:thymeleaf-extras-springsecurity4')
	compile('org.springframework.hateoas:spring-hateoas')
	compile('mysql:mysql-connector-java')
	
	//Executable WAR
	//providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
	
	testCompile('org.springframework.boot:spring-boot-starter-test') 
}


eclipse {
	classpath {
		 containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
		 containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
	}
}

task wrapper(type: Wrapper) {
	gradleVersion = '2.9'
}
